fitzRoy v1.3.0 on CRAN

Author

James Day

Published

March 2, 2023

I’m pleased to announce that fitzRoy v1.3.0 has just been accepted to CRAN!

This update mostly contains bug fixes. You can read about them below.

Deprecated functions

All of the get_ family of functions are now formally following the deprecation lifecycle used in the {lifecycle} package. That is, there is now a formal warning for using these functions. The next version of fitzRoy will hard deprecate these functions, where calling them will return an error. Given these have been technically deprecated since v1.0.0, this is plenty of warning.

# install.packages("fitzRoy")
library(fitzRoy)

fitzRoy:::get_fixture(2020)
Warning: `get_fixture()` was deprecated in fitzRoy 1.0.0.
ℹ Please use `fetch_fixture()` instead.
# A tibble: 162 × 7
   Date                Season Season.Game Round Home.Team       Away.Team  Venue
   <dttm>               <dbl>       <int> <dbl> <chr>           <chr>      <chr>
 1 2020-03-19 19:40:00   2020           1     1 Richmond        Carlton    M.C.…
 2 2020-03-20 19:50:00   2020           2     1 Footscray       Collingwo… Dock…
 3 2020-03-21 14:10:00   2020           3     1 Essendon        Fremantle  Dock…
 4 2020-03-21 16:35:00   2020           4     1 Adelaide        Sydney     Adel…
 5 2020-03-21 18:40:00   2020           5     1 Gold Coast      Port Adel… Carr…
 6 2020-03-21 19:40:00   2020           6     1 GWS             Geelong    Sydn…
 7 2020-03-22 13:05:00   2020           7     1 North Melbourne St Kilda   Dock…
 8 2020-03-22 15:35:00   2020           8     1 Hawthorn        Brisbane … M.C.…
 9 2020-03-22 15:40:00   2020           9     1 West Coast      Melbourne  Pert…
10 2020-06-11 19:40:00   2020          10     2 Collingwood     Richmond   M.C.…
# … with 152 more rows

fetch_player_stats_afl

Fixed an issue with fetch_player_stats_afl where an error was being returned for the new season. It now returns NULL if there is no data for the specified season

fetch_player_stats_afl(2023, round_number = 1)
ℹ Fetching match ids
✔ Fetching match ids ... done
ℹ Finding player stats for 9 matches.
✔ Finding player stats for 9 matches. ... done
ℹ No completed matches found
NULL

Debut players in fetch_player_stats_afltables

Fixed an annoying bug where players who debuted in 2023 were getting assigned an ID of 0 in AFL Tables Data. This is now resolved and all ID’s should be correctly assigned for new players

df <- fetch_player_stats_afltables(2022)
ℹ Looking for data from 2022-01-01 to 2022-12-31
ℹ fetching cached data from <]8;;github.comgithub.com]8;;>
✔ fetching cached data from <]8;;github.comgithub.com]8;;> ... done
Finished getting afltables data
df |> 
  dplyr::filter(ID == 0)
# A tibble: 0 × 59
# … with 59 variables: Season <dbl>, Round <chr>, Date <date>,
#   Local.start.time <int>, Venue <chr>, Attendance <dbl>, Home.team <chr>,
#   HQ1G <int>, HQ1B <int>, HQ2G <int>, HQ2B <int>, HQ3G <int>, HQ3B <int>,
#   HQ4G <int>, HQ4B <int>, Home.score <int>, Away.team <chr>, AQ1G <int>,
#   AQ1B <int>, AQ2G <int>, AQ2B <int>, AQ3G <int>, AQ3B <int>, AQ4G <int>,
#   AQ4B <int>, Away.score <int>, First.name <chr>, Surname <chr>, ID <dbl>,
#   Jumper.No. <chr>, Playing.for <chr>, Kicks <dbl>, Marks <dbl>, …

Smaller Bug Fixes

  • Fixed a range of unhelpful messages and warnings

  • Fixed a bug in fetch_player_stats_footywire that was caused by an update to the website

Enjoy!