Overview

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.

Getting Data

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> 12464, 12686, 12584, 11931, 12341, 1248…
#> $ player_first_name              <chr> "Nathan", "Noah", "Jack", "Maverick", "…
#> $ player_last_name               <chr> "Broad", "Balta", "Graham", "Weller", "…
#> $ player_height_cm               <int> 192, 194, 181, NA, 178, 186, 175, 179, …
#> $ player_weight_kg               <int> 89, 100, 82, NA, 77, 83, 82, 76, 95, 83…
#> $ player_is_retired              <lgl> FALSE, FALSE, FALSE, TRUE, FALSE, FALSE…
#> $ player_team                    <chr> "Richmond", "Richmond", "Richmond", "Ri…
#> $ guernsey_number                <int> 35, 38, 34, 16, 23, 28, 3, 17, 30, 14, …
#> $ kicks                          <int> 4, 5, 16, 9, 12, 9, 10, 10, 10, 16, 18,…
#> $ marks                          <int> 1, 2, 7, 2, 7, 5, 1, 4, 1, 6, 4, 6, 2, …
#> $ handballs                      <int> 4, 0, 7, 6, 18, 13, 10, 7, 2, 8, 12, 11…
#> $ disposals                      <int> 8, 5, 23, 15, 30, 22, 20, 17, 12, 24, 3…
#> $ effective_disposals            <int> 6, 4, 16, 14, 23, 15, 14, 13, 6, 22, 19…
#> $ disposal_efficiency_percentage <int> 75, 80, 70, 93, 77, 68, 70, 77, 50, 92,…
#> $ goals                          <int> 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, …
#> $ behinds                        <int> 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 0, …
#> $ hitouts                        <int> 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ tackles                        <int> 2, 1, 6, 1, 4, 5, 7, 2, 1, 4, 0, 4, 1, …
#> $ rebounds                       <int> 2, 0, 0, 2, 1, 0, 0, 0, 0, 8, 1, 0, 0, …
#> $ inside_fifties                 <int> 0, 3, 5, 3, 3, 5, 5, 4, 2, 3, 7, 6, 0, …
#> $ clearances                     <int> 0, 1, 4, 1, 3, 3, 4, 2, 0, 1, 5, 6, 0, …
#> $ clangers                       <int> 2, 5, 6, 1, 4, 7, 2, 0, 4, 2, 7, 5, 1, …
#> $ free_kicks_for                 <int> 1, 1, 1, 0, 2, 1, 3, 1, 0, 1, 0, 2, 1, …
#> $ free_kicks_against             <int> 0, 3, 1, 0, 0, 2, 0, 0, 2, 0, 3, 4, 1, …
#> $ brownlow_votes                 <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, …
#> $ contested_possessions          <int> 3, 2, 9, 4, 10, 10, 9, 6, 6, 4, 15, 14,…
#> $ uncontested_possessions        <int> 5, 4, 15, 11, 19, 15, 11, 10, 5, 14, 17…
#> $ contested_marks                <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, …
#> $ marks_inside_fifty             <int> 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, …
#> $ one_percenters                 <int> 6, 2, 2, 2, 0, 0, 1, 2, 0, 2, 2, 2, 0, …
#> $ bounces                        <int> 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, …
#> $ goal_assists                   <int> 0, 0, 0, 0, 0, 1, 1, 2, 0, 1, 1, 0, 0, …
#> $ time_on_ground_percentage      <int> 80, 52, 81, 85, 89, 79, 78, 88, 94, 83,…
#> $ afl_fantasy_score              <int> 32, 29, 106, 60, 112, 83, 80, 67, 41, 1…
#> $ supercoach_score               <int> 45, 18, 88, 63, 95, 67, 82, 82, 44, 112…
#> $ centre_clearances              <int> 0, 1, 2, 0, 0, 2, 1, 1, 0, 0, 2, 1, 0, …
#> $ stoppage_clearances            <int> 0, 0, 2, 1, 3, 1, 3, 1, 0, 1, 3, 5, 0, …
#> $ score_involvements             <int> 0, 2, 5, 4, 9, 6, 7, 9, 4, 5, 11, 8, 2,…
#> $ metres_gained                  <int> 187, 223, 475, 313, 412, 328, 342, 317,…
#> $ turnovers                      <int> 1, 2, 5, 3, 4, 4, 3, 1, 3, 4, 8, 6, 2, …
#> $ intercepts                     <int> 3, 1, 3, 1, 4, 0, 3, 1, 0, 8, 2, 5, 1, …
#> $ tackles_inside_fifty           <int> 0, 0, 1, 0, 1, 2, 0, 1, 0, 0, 0, 0, 1, …
#> $ contest_def_losses             <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ contest_def_one_on_ones        <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, …
#> $ contest_off_one_on_ones        <int> 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 3, 0, 2, …
#> $ contest_off_wins               <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, …
#> $ def_half_pressure_acts         <int> 7, 4, 13, 2, 10, 3, 13, 5, 0, 12, 3, 7,…
#> $ effective_kicks                <int> 3, 4, 12, 8, 7, 5, 7, 7, 5, 14, 10, 9, …
#> $ f50_ground_ball_gets           <int> 0, 0, 1, 0, 0, 1, 2, 1, 2, 0, 1, 0, 0, …
#> $ ground_ball_gets               <int> 2, 0, 6, 2, 7, 6, 6, 5, 6, 3, 9, 11, 0,…
#> $ hitouts_to_advantage           <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ hitout_win_percentage          <dbl> 0.0, 31.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0…
#> $ intercept_marks                <int> 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, …
#> $ marks_on_lead                  <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, …
#> $ pressure_acts                  <int> 10, 11, 23, 18, 28, 16, 26, 11, 7, 17, …
#> $ rating_points                  <dbl> 6.1, 5.1, 8.7, 11.8, 11.5, 4.7, 14.5, 1…
#> $ ruck_contests                  <int> 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ score_launches                 <int> 0, 1, 0, 0, 0, 1, 1, 2, 0, 2, 1, 4, 1, …
#> $ shots_at_goal                  <int> 0, 2, 1, 2, 2, 1, 0, 2, 2, 0, 0, 1, 2, …
#> $ spoils                         <int> 6, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, …
#> $ subbed                         <chr> "Not Subbed", "Not Subbed", "Not Subbed…
#> $ player_position                <chr> "INT", "INT", "INT", "INT", "R", "HFFL"…
#> $ 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 x 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
#> # … with 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>,
#> #   player_weight_kg <int>, player_is_retired <lgl>, player_team <chr>,
#> #   guernsey_number <int>, kicks <int>, marks <int>, handballs <int>,
#> #   disposals <int>, effective_disposals <int>,
#> #   disposal_efficiency_percentage <int>, goals <int>, behinds <int>,
#> #   hitouts <int>, tackles <int>, rebounds <int>, inside_fifties <int>,
#> #   clearances <int>, clangers <int>, free_kicks_for <int>,
#> #   free_kicks_against <int>, brownlow_votes <int>,
#> #   contested_possessions <int>, uncontested_possessions <int>,
#> #   contested_marks <int>, marks_inside_fifty <int>, one_percenters <int>,
#> #   bounces <int>, goal_assists <int>, time_on_ground_percentage <int>,
#> #   afl_fantasy_score <int>, supercoach_score <int>, centre_clearances <int>,
#> #   stoppage_clearances <int>, score_involvements <int>, metres_gained <int>,
#> #   turnovers <int>, intercepts <int>, tackles_inside_fifty <int>,
#> #   contest_def_losses <int>, contest_def_one_on_ones <int>,
#> #   contest_off_one_on_ones <int>, contest_off_wins <int>,
#> #   def_half_pressure_acts <int>, effective_kicks <int>,
#> #   f50_ground_ball_gets <int>, ground_ball_gets <int>,
#> #   hitouts_to_advantage <int>, hitout_win_percentage <dbl>,
#> #   intercept_marks <int>, marks_on_lead <int>, pressure_acts <int>,
#> #   rating_points <dbl>, ruck_contests <int>, score_launches <int>,
#> #   shots_at_goal <int>, spoils <int>, subbed <chr>, player_position <chr>,
#> #   date <date>