We have included a function to interface with the Fryzigg API. This data set includes advanced AFL stats that are typically not available on existing open data sites such as footywire.com and afltables.com. Many thanks to Fryzigg on providing this API interface.
The primary way to access the data is via the
fetch_fryzigg_stats()
function. This function provides an
easy interface to the Fryzigg API. It takes one arguments -
season
which can be a single year or multiple years.
dat <- fitzRoy::fetch_player_stats_fryzigg(2019)
We can get a quick view the the fields returned from the
fryzigg
API.
dplyr::glimpse(dat)
#> Rows: 9,108
#> Columns: 81
#> $ venue_name <chr> "MCG", "MCG", "MCG", "MCG", "MCG", "MCG…
#> $ match_id <int> 15408, 15408, 15408, 15408, 15408, 1540…
#> $ match_home_team <chr> "Carlton", "Carlton", "Carlton", "Carlt…
#> $ match_away_team <chr> "Richmond", "Richmond", "Richmond", "Ri…
#> $ match_date <chr> "2019-03-21", "2019-03-21", "2019-03-21…
#> $ match_local_time <chr> "19:25:00", "19:25:00", "19:25:00", "19…
#> $ match_attendance <int> 85016, 85016, 85016, 85016, 85016, 8501…
#> $ match_round <chr> "1", "1", "1", "1", "1", "1", "1", "1",…
#> $ match_home_team_goals <int> 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, …
#> $ match_home_team_behinds <int> 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,…
#> $ match_home_team_score <int> 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,…
#> $ match_away_team_goals <int> 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,…
#> $ match_away_team_behinds <int> 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,…
#> $ match_away_team_score <int> 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,…
#> $ match_margin <int> 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,…
#> $ match_winner <chr> "Richmond", "Richmond", "Richmond", "Ri…
#> $ match_weather_temp_c <int> 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,…
#> $ match_weather_type <chr> "OVERCAST", "OVERCAST", "OVERCAST", "OV…
#> $ player_id <int> 11285, 11472, 11473, 11561, 11573, 1158…
#> $ player_first_name <chr> "Kade", "Marc", "Dale", "Shane", "Bacha…
#> $ player_last_name <chr> "Simpson", "Murphy", "Thomas", "Edwards…
#> $ player_height_cm <int> 183, 180, NA, 182, 180, 193, 185, 194, …
#> $ player_weight_kg <int> 73, 81, NA, 78, 83, 92, 86, 96, 91, 94,…
#> $ player_is_retired <lgl> FALSE, FALSE, TRUE, FALSE, FALSE, FALSE…
#> $ player_team <chr> "Carlton", "Carlton", "Carlton", "Richm…
#> $ guernsey_number <int> 6, 3, 39, 10, 14, 8, 9, 18, 4, 12, 14, …
#> $ kicks <int> 14, 16, 15, 8, 16, 6, 20, 3, 18, 5, 4, …
#> $ marks <int> 6, 4, 3, 0, 6, 2, 6, 2, 4, 1, 3, 1, 12,…
#> $ handballs <int> 11, 13, 12, 14, 8, 2, 11, 3, 12, 4, 4, …
#> $ disposals <int> 25, 29, 27, 22, 24, 8, 31, 6, 30, 9, 8,…
#> $ effective_disposals <int> 19, 21, 23, 18, 22, 4, 16, 5, 19, 7, 7,…
#> $ disposal_efficiency_percentage <int> 76, 72, 85, 82, 92, 50, 52, 83, 63, 78,…
#> $ goals <int> 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
#> $ behinds <int> 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, …
#> $ hitouts <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ tackles <int> 1, 1, 2, 4, 4, 2, 4, 2, 0, 0, 5, 4, 3, …
#> $ rebounds <int> 5, 4, 5, 0, 8, 0, 0, 2, 1, 2, 3, 2, 1, …
#> $ inside_fifties <int> 1, 5, 3, 3, 3, 1, 6, 0, 7, 0, 0, 1, 3, …
#> $ clearances <int> 1, 1, 0, 5, 1, 0, 6, 0, 5, 0, 1, 1, 2, …
#> $ clangers <int> 1, 1, 4, 1, 2, 7, 5, 5, 7, 0, 2, 2, 4, …
#> $ free_kicks_for <int> 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 3, 1, 1, …
#> $ free_kicks_against <int> 0, 0, 1, 0, 0, 4, 4, 2, 3, 0, 1, 1, 0, …
#> $ brownlow_votes <int> 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, …
#> $ contested_possessions <int> 4, 6, 6, 11, 4, 9, 14, 4, 15, 4, 7, 5, …
#> $ uncontested_possessions <int> 19, 23, 17, 12, 14, 2, 14, 2, 17, 4, 2,…
#> $ contested_marks <int> 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, …
#> $ marks_inside_fifty <int> 0, 0, 0, 0, 0, 2, 1, 0, 1, 0, 0, 0, 2, …
#> $ one_percenters <int> 1, 0, 4, 1, 2, 3, 2, 7, 2, 3, 7, 7, 1, …
#> $ bounces <int> 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, …
#> $ goal_assists <int> 0, 0, 1, 1, 1, 2, 0, 0, 1, 0, 0, 0, 1, …
#> $ time_on_ground_percentage <int> 84, 87, 78, 85, 83, 98, 80, 68, 79, 92,…
#> $ afl_fantasy_score <int> 92, 97, 90, 69, 102, 32, 107, 24, 81, 2…
#> $ supercoach_score <int> 83, 91, 93, 92, 112, 50, 98, 36, 109, 4…
#> $ centre_clearances <int> 0, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 0, 0, …
#> $ stoppage_clearances <int> 1, 1, 0, 3, 1, 0, 5, 0, 3, 0, 1, 1, 2, …
#> $ score_involvements <int> 2, 7, 8, 9, 5, 5, 8, 0, 11, 4, 1, 0, 8,…
#> $ metres_gained <int> 462, 530, 434, 259, 486, 71, 548, 45, 6…
#> $ turnovers <int> 2, 5, 4, 1, 4, 7, 6, 1, 8, 0, 1, 1, 6, …
#> $ intercepts <int> 6, 3, 6, 5, 8, 2, 5, 6, 2, 5, 8, 6, 0, …
#> $ tackles_inside_fifty <int> 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 2, …
#> $ contest_def_losses <int> 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, …
#> $ contest_def_one_on_ones <int> 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 5, 4, 0, …
#> $ contest_off_one_on_ones <int> 0, 0, 0, 0, 0, 4, 0, 0, 3, 0, 0, 0, 0, …
#> $ contest_off_wins <int> 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, …
#> $ def_half_pressure_acts <int> 6, 5, 12, 8, 12, 0, 7, 6, 3, 6, 10, 17,…
#> $ effective_kicks <int> 9, 9, 12, 4, 14, 2, 9, 2, 10, 4, 4, 3, …
#> $ f50_ground_ball_gets <int> 0, 2, 0, 2, 0, 4, 0, 0, 1, 0, 0, 0, 4, …
#> $ ground_ball_gets <int> 4, 5, 5, 8, 3, 5, 11, 3, 9, 4, 2, 3, 6,…
#> $ hitouts_to_advantage <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ hitout_win_percentage <dbl> 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,…
#> $ intercept_marks <int> 2, 0, 0, 0, 1, 0, 1, 2, 1, 0, 3, 1, 0, …
#> $ marks_on_lead <int> 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ pressure_acts <int> 8, 12, 15, 14, 17, 4, 19, 6, 6, 6, 11, …
#> $ rating_points <dbl> 7.7, 14.9, 14.0, 22.6, 16.0, 3.1, 12.6,…
#> $ ruck_contests <int> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
#> $ score_launches <int> 1, 0, 2, 3, 2, 1, 4, 0, 1, 2, 1, 0, 2, …
#> $ shots_at_goal <int> 0, 1, 1, 0, 0, 4, 1, 0, 0, 0, 0, 0, 1, …
#> $ spoils <int> 1, 0, 3, 0, 2, 0, 2, 6, 1, 3, 5, 6, 0, …
#> $ subbed <chr> "Not Subbed", "Not Subbed", "Not Subbed…
#> $ player_position <chr> "HBFL", "WL", "HBFR", "WL", "CHB", "FPL…
#> $ date <date> 2019-03-21, 2019-03-21, 2019-03-21, 20…
You can see the data includes both player and team data, where each row is a game by a player.
head(dat)
#> # A tibble: 6 × 81
#> venue_name match_id match_home_team match_away_team match_date
#> <chr> <int> <chr> <chr> <chr>
#> 1 MCG 15408 Carlton Richmond 2019-03-21
#> 2 MCG 15408 Carlton Richmond 2019-03-21
#> 3 MCG 15408 Carlton Richmond 2019-03-21
#> 4 MCG 15408 Carlton Richmond 2019-03-21
#> 5 MCG 15408 Carlton Richmond 2019-03-21
#> 6 MCG 15408 Carlton Richmond 2019-03-21
#> # ℹ 76 more variables: match_local_time <chr>, match_attendance <int>,
#> # match_round <chr>, match_home_team_goals <int>,
#> # match_home_team_behinds <int>, match_home_team_score <int>,
#> # match_away_team_goals <int>, match_away_team_behinds <int>,
#> # match_away_team_score <int>, match_margin <int>, match_winner <chr>,
#> # match_weather_temp_c <int>, match_weather_type <chr>, player_id <int>,
#> # player_first_name <chr>, player_last_name <chr>, player_height_cm <int>, …