fitzRoy v1.7.0 on CRAN

Author

James Day

Published

March 12, 2025

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

You can read about all the changes below.

library(fitzRoy)

New Features

Fantasy and Supercoach scores

New functions have been added to fetch AFL Fantasy (Dream Team) and Supercoach round scores from Footywire.

  • fetch_scores() - Wrapper function to fetch either scoring system. Specify type = "supercoach" or type = "dream_team" along with a year and rounds.
  • fetch_supercoach_scores() - Fetch Supercoach scores directly.
  • fetch_fantasy_scores() - Fetch AFL Fantasy scores directly.
fitzRoy::fetch_scores(type = "supercoach", year = 2025, rounds = 1) |> head()
Fetching "supercoach" 2025 Round 1 ...
# A tibble: 6 × 10
   year round  rank player         team  current_salary round_salary round_score
  <dbl> <dbl> <int> <chr>          <chr>          <dbl>        <dbl>       <dbl>
1  2025     1     1 "Josh Dunkley" Lions         621100       602300         173
2  2025     1     2 "Tom De Konin… Blues         524200       547100         148
3  2025     1     3 "Bailey Smith" Cats          638300       389200         147
4  2025     1     4 "Jarrod Witts" Suns          568500       581300         144
5  2025     1     5 "Dayne Zorko"  Lions         555300       595100         139
6  2025     1     6 "Matt Rowell\… Suns          641400       550300         137
# ℹ 2 more variables: round_value <dbl>, injured <lgl>
fitzRoy::fetch_scores(type = "dream_team", year = 2025, rounds = 1) |> head()
Fetching "dream_team" 2025 Round 1 ...
# A tibble: 6 × 10
   year round  rank player        team   current_salary round_salary round_score
  <dbl> <dbl> <int> <chr>         <chr>           <dbl>        <dbl>       <dbl>
1  2025     1     1 Jye Caldwell  Bombe…        1087000       969000         146
2  2025     1     2 Tom De Koning Blues          889000       900000         132
3  2025     1     3 Josh Dunkley  Lions         1128000      1102000         130
4  2025     1     4 Tristan Xerri Kanga…        1101000      1175000         129
5  2025     1     5 Max Gawn      Demons        1188000      1147000         127
6  2025     1     6 Bailey Smith  Cats          1220000       598000         126
# ℹ 2 more variables: round_value <dbl>, injured <lgl>

Each returns player-level data for the specified rounds, including rank, salary, round score, and value.

AFL Awards

A new fetch_awards() wrapper function has been added to retrieve data for three major AFL awards from Footywire.

  • fetch_awards_brownlow() - Returns player and team Brownlow vote tallies for a given season.
  • fetch_awards_allaustralian() - Returns the final All-Australian team (22 players) or the initial squad (44 players).
  • fetch_rising_star() - Returns Rising Star nominations and round-level performance stats.
# Player vote tallies
fitzRoy::fetch_awards(2024, award = "brownlow", type = "player")
# A tibble: 196 × 11
   Season Player          Team  Votes Votes_3 Votes_2 Votes_1 Players_With_Votes
    <dbl> <chr>           <chr> <dbl>   <int>   <int>   <int>              <int>
 1   2024 Patrick Cripps… Blues   163      45      12       4                  1
 2   2024 Nick Daicos     Magp…   134      38       7       6                  5
 3   2024 Zak Butters     Power   104      29       7       3                  2
 4   2024 Caleb Serong    Dock…   101      28       7       3                  1
 5   2024 Isaac Heeney    Swans   101      28       7       3                  1
 6   2024 Tom Green       Gian…    96      27       7       1                  4
 7   2024 Adam Treloar    Bull…    91      26       3       7                  3
 8   2024 Matt Rowell     Suns     90      25       6       3                  1
 9   2024 Errol Gulden    Swans    89      25       4       6                  1
10   2024 Jai Newcombe    Hawks    86      24       5       4                  1
# ℹ 186 more rows
# ℹ 3 more variables: Games_Polled <int>, Polled <chr>, V_G <chr>
# Team vote summary
fitzRoy::fetch_awards(2024, award = "brownlow", type = "team")
# A tibble: 18 × 9
   Season Team     Votes Votes_3 Votes_2 Votes_1 Players_With_Votes Games_Polled
    <dbl> <chr>    <dbl>   <int>   <int>   <int>              <int>        <int>
 1   2024 Sydney     362     103      19      15                 16           12
 2   2024 Western…   318      91      16      13                 17           13
 3   2024 Carlton    306      87      15      15                 12           12
 4   2024 Fremant…   304      87      14      15                 15           12
 5   2024 GWS        299      85      15      14                 12           14
 6   2024 Port Ad…   297      84      17      11                 11            9
 7   2024 Brisbane   287      82      14      13                 14           11
 8   2024 Hawthorn   287      82      13      15                 13           14
 9   2024 Colling…   239      68      12      11                 10            9
10   2024 Geelong    237      68      12       9                 14           13
11   2024 Essendon   236      67      10      15                  7           12
12   2024 Melbour…   235      67      10      14                  9           12
13   2024 Gold Co…   223      64      10      11                 12            9
14   2024 St Kilda   224      64      11      10                 11           13
15   2024 Adelaide   181      52       9       7                 11            9
16   2024 North M…   146      42       6       8                  8            8
17   2024 West Co…   102      30       3       6                  9            6
18   2024 Richmond    64      19       1       5                  6            8
# ℹ 1 more variable: V_G <chr>
fitzRoy::fetch_awards(2023, award = "allaustralian", type = "team")
# A tibble: 22 × 4
   Season Position Player        Team 
    <dbl> <chr>    <chr>         <chr>
 1   2023 FB       J Sicily      HAW  
 2   2023 FB       C Wilkie      STK  
 3   2023 FB       T Stewart     GEEL 
 4   2023 HB       J Sinclair    STK  
 5   2023 HB       D Moore       COLL 
 6   2023 HB       D Houston     PORT 
 7   2023 C        E Gulden      SYD  
 8   2023 C        M Bontempelli WB   
 9   2023 C        J Daicos      COLL 
10   2023 HF       C Rozee       PORT 
# ℹ 12 more rows
fitzRoy::fetch_awards(2023, award = "allaustralian", type = "squad")
# A tibble: 21 × 3
   Season Team        Player         
    <dbl> <chr>       <chr>          
 1   2023 Brisbane    Harris Andrews 
 2   2023 Brisbane    Joe Daniher    
 3   2023 Brisbane    Lachie Neale   
 4   2023 Carlton     Patrick Cripps 
 5   2023 Carlton     Jacob Weitering
 6   2023 Collingwood Jordan De Goey 
 7   2023 Collingwood Isaac Quaynor  
 8   2023 Essendon    Kyle Langford  
 9   2023 Essendon    Mason Redman   
10   2023 Fremantle   Luke Jackson   
# ℹ 11 more rows
# All nominations for the season
fitzRoy::fetch_awards(2024, award = "risingstar", type = "nominations")
# A tibble: 25 × 22
   Season Round Player      Team  Opponent Kicks Handballs Disposals Marks Goals
    <dbl> <dbl> <chr>       <chr> <chr>    <dbl>     <dbl>     <dbl> <dbl> <dbl>
 1   2024     0 M Roberts   Swans Demons      16         3        19     8     0
 2   2024     1 O Dempsey   Cats  Saints      13         2        15     7     3
 3   2024     2 G Wardlaw   Kang… Dockers     10        13        23     6     1
 4   2024     3 H Gallagher Bull… Eagles      12         4        16     7     2
 5   2024     4 S Darcy     Bull… Cats        10         2        12     3     3
 6   2024     5 H Reid      Eagl… Tigers      11        16        27     3     1
 7   2024     6 D Wilson    Sain… Bulldogs     8         7        15     4     1
 8   2024     7 J Rogers    Suns  Eagles      10        12        22     1     1
 9   2024     8 C Windsor   Demo… Cats        11         7        18     6     1
10   2024     9 C McKercher Kang… Suns        21         9        30     2     0
# ℹ 15 more rows
# ℹ 12 more variables: Behinds <dbl>, Tackles <dbl>, Hitouts <dbl>,
#   Goal_Assists <dbl>, Inside_50s <dbl>, Clearances <dbl>, Clangers <dbl>,
#   Rebound_50s <dbl>, Frees_For <dbl>, Frees_Against <dbl>, Supercoach <dbl>,
#   Fantasy <dbl>
# Stats for a specific round's nominees
fitzRoy::fetch_awards(2024, award = "risingstar", round_number = 5, type = "stats")
# A tibble: 34 × 24
   Season Round Player      Nomination Team      Opponent Result Kicks Handballs
    <dbl> <dbl> <chr>       <chr>      <chr>     <chr>    <chr>  <dbl>     <dbl>
 1   2024     5 H Reid      "R5"       Eagles    Tigers   Win 1…    11        16
 2   2024     5 D Wilson    "R6"       Saints    Giants   Loss …    16         3
 3   2024     5 L Nankervis "R13"      Crows     Blues    Win 1…     9         9
 4   2024     5 H Thomas    "R14"      Giants    Saints   Win 8…    10         7
 5   2024     5 B Drury     ""         Kangaroos Cats     Loss …    13         4
 6   2024     5 G Wardlaw   "R2"       Kangaroos Cats     Loss …    12         4
 7   2024     5 B Howes     ""         Demons    Lions    Loss …     8         7
 8   2024     5 W Graham    "R16"      Suns      Hawks    Win 1…     8         6
 9   2024     5 S Darcy     "R4"       Bulldogs  Bombers  Loss …     9         4
10   2024     5 O Dempsey   "R1"       Cats      Kangaro… Win 1…     8         5
# ℹ 24 more rows
# ℹ 15 more variables: Disposals <dbl>, Marks <dbl>, Goals <dbl>,
#   Behinds <dbl>, Tackles <dbl>, Hitouts <dbl>, Goal_Assists <dbl>,
#   Inside_50s <dbl>, Clearances <dbl>, Clangers <dbl>, Rebound_50s <dbl>,
#   Frees_For <dbl>, Frees_Against <dbl>, Fantasy <dbl>, Supercoach <dbl>

Out-of-contract players

fetch_outofcontract() returns a list of players whose contracts expire at the end of a given year — useful for team list analysis and end-of-season trade period research. Data is available from 2025 onwards.

fitzRoy::fetch_outofcontract(year = 2026)
# A tibble: 307 × 4
   Player          Years_Service Status                  Club    
   <chr>           <chr>         <chr>                   <chr>   
 1 Billy Dowling   4             Non-Free Agent          Adelaide
 2 Brayden Cook    6             Non-Free Agent          Adelaide
 3 Charlie Edwards 3             Non-Free Agent          Adelaide
 4 Chayce Jones    8             Restricted Free Agent   Adelaide
 5 Finnbar Maley   1             Non-Free Agent          Adelaide
 6 James Borlase   6             Unrestricted Free Agent Adelaide
 7 Jordon Butts    8             Restricted Free Agent   Adelaide
 8 Lachlan Sholl   8             Restricted Free Agent   Adelaide
 9 Luke Pedlar     6             Non-Free Agent          Adelaide
10 Mitchell Hinge  6             Unrestricted Free Agent Adelaide
# ℹ 297 more rows

Team statistics

A new fetch_team_stats() wrapper has been added for retrieving team-level aggregate statistics. It supports three sources: AFL Tables, Footywire, and VFL Stats.

# Team totals from AFL Tables
fitzRoy::fetch_team_stats(2024, summary_type = "totals", source = "afltables")
ℹ Downloading team stats from AFLTables for 2024
✔ Downloading team stats from AFLTables for 2024 [177ms]
# A tibble: 18 × 65
   season Team      KI_for KI_against MK_for MK_against HB_for HB_against DI_for
    <dbl> <chr>      <int>      <int>  <int>      <int>  <int>      <int>  <int>
 1   2024 Adelaide    4899       4907   2023       1945   3401       3166   8300
 2   2024 Brisbane…   6281       5381   2983       2237   3476       3820   9757
 3   2024 Carlton     5210       4887   2193       2081   3410       3376   8620
 4   2024 Collingw…   4684       5069   1867       2250   3199       3423   7883
 5   2024 Essendon    5091       4904   2274       2139   3657       3291   8748
 6   2024 Fremantle   4747       4822   2141       2203   3698       3155   8445
 7   2024 Geelong     5397       5490   2201       2299   3363       3593   8760
 8   2024 Gold Coa…   4642       4965   1949       2122   3345       3337   7987
 9   2024 Greater …   5222       5086   2207       2016   4091       3534   9313
10   2024 Hawthorn    5258       5163   2276       2311   3741       3388   8999
11   2024 Melbourne   4894       5108   2167       2303   3059       3343   7953
12   2024 North Me…   4773       4806   2034       2102   3361       3383   8134
13   2024 Port Ade…   5687       5295   2464       2140   3271       3578   8958
14   2024 Richmond    4593       5306   1962       2526   3186       3440   7779
15   2024 St Kilda    5209       5067   2406       2303   3172       3231   8381
16   2024 Sydney      5720       5537   2484       2443   3537       3637   9257
17   2024 West Coa…   4391       5019   1939       2275   2873       3462   7264
18   2024 Western …   5204       5090   2340       2215   3698       3381   8902
# ℹ 56 more variables: DI_against <int>, GL_for <int>, GL_against <int>,
#   BH_for <int>, BH_against <int>, HO_for <int>, HO_against <int>,
#   TK_for <int>, TK_against <int>, RB_for <int>, RB_against <int>,
#   IF_for <int>, IF_against <int>, CL_for <int>, CL_against <int>,
#   CG_for <int>, CG_against <int>, FF_for <int>, FF_against <int>,
#   BR_for <int>, BR_against <int>, CP_for <int>, CP_against <int>,
#   UP_for <int>, UP_against <int>, CM_for <int>, CM_against <int>, …
# Per-game averages from Footywire
fitzRoy::fetch_team_stats(2024, summary_type = "averages", source = "footywire")
ℹ Fetching averages team stats from Footywire for 2024
✔ Fetching averages team stats from Footywire for 2024 [1.8s]
# A tibble: 18 × 22
   season summary  type  Team    Games     K    HB     D     M     G    GA   I50
    <dbl> <chr>    <chr> <chr>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
 1   2024 averages team  Bombers    23  221.  159.  380.  98.9  12     9    55.6
 2   2024 averages team  Giants     25  209.  164.  372.  88.3  13.2   9.5  50.6
 3   2024 averages team  Bulldo…    24  217.  154.  371.  97.5  13.4   8.8  56.5
 4   2024 averages team  Dockers    23  206.  161.  367.  93    12.4   9.3  51  
 5   2024 averages team  Saints     23  226.  138.  364. 105.   11     8    49  
 6   2024 averages team  Lions      27  233.  129.  361. 110.   13.5   9.2  56.5
 7   2024 averages team  Crows      23  213   148.  361.  88    12.1   8.8  49.2
 8   2024 averages team  Hawks      25  210.  150.  360   91    13.2   9.4  53.9
 9   2024 averages team  Blues      24  217.  142.  359.  91.4  13.6   9.3  51.7
10   2024 averages team  Swans      26  220   136   356   95.5  14    10.1  53.4
11   2024 averages team  Kangar…    23  208.  146.  354.  88.4  10.6   7.5  45.3
12   2024 averages team  Cats       25  216.  134.  350.  88    14.1   9.8  54.6
13   2024 averages team  Suns       23  202.  145.  347.  84.7  12.2   8.5  56  
14   2024 averages team  Demons     23  213.  133.  346.  94.3  11.3   8.3  49  
15   2024 averages team  Power      26  219.  126.  344.  94.8  11.9   8.7  54.5
16   2024 averages team  Magpies    23  204.  139.  343.  81.2  12.5   8.9  49.7
17   2024 averages team  Tigers     23  200.  138.  338.  85.3   9.2   6.7  47.9
18   2024 averages team  Eagles     23  191.  125.  316.  84.3  10     6.8  46  
# ℹ 10 more variables: BH <dbl>, T <dbl>, HO <dbl>, FF <dbl>, FA <dbl>,
#   CL <dbl>, CG <dbl>, R50 <dbl>, AF <dbl>, SC <dbl>
# VFL Men's team stats
fitzRoy::fetch_team_stats(2024, source = "vflstats", comp = "VFLM")
ℹ Fetching team stats from VFLM 2024...
✔ Fetching team stats from VFLM 2024... [11.3s]
# A tibble: 21 × 16
   season summary type  comp  Team         Games Kicks Handballs Disposals Marks
    <dbl> <chr>   <chr> <chr> <chr>        <int> <int>     <int>     <int> <int>
 1   2024 totals  team  VFLM  Box Hill Ha…   431  4091      2557      6648  1921
 2   2024 totals  team  VFLM  Brisbane Li…   478  4802      2579      7381  2198
 3   2024 totals  team  VFLM  Carlton        413  3575      2504      6079  1487
 4   2024 totals  team  VFLM  Casey Demons   412  3558      2213      5771  1360
 5   2024 totals  team  VFLM  Coburg Lions   413  3589      2949      6538  1523
 6   2024 totals  team  VFLM  Collingwood…   405  3486      2363      5849  1465
 7   2024 totals  team  VFLM  Essendon VFL   409  3744      2671      6415  1572
 8   2024 totals  team  VFLM  Footscray B…   460  4136      3094      7230  1739
 9   2024 totals  team  VFLM  Frankston D…   460  3951      2329      6280  1513
10   2024 totals  team  VFLM  GWS Giants     401  3585      2266      5851  1504
# ℹ 11 more rows
# ℹ 6 more variables: Tackles <int>, Hitouts <int>, Fantasy <int>, Goals <int>,
#   Behinds <int>, Score <int>

Bug Fixes

  • Fixed duplicates for most recent game in fetch_player_stats_afltables() (#250)
  • Fixed issues for fetch_player_details when indigenous names are used (#261, #262)
  • Updated replace_teams() to handle the new AFL.com.au spelling of Wallitj Marawar (#259)
  • Fixed issue with fetch_player_footywire_stats not working with the new season

Enjoy!