Match data

library(fitzRoy)
library(dplyr)

We can use the get_aflw_match_data() function to retrieve match data for all matches.

Note that there will be warnings if a fixture is available but no match data has been added yet. If this is the case, make sure you don’t try to request detailed match stats for these match IDs.

glimpse(match_data)
#> Observations: 152
#> Variables: 30
#> $ Match.Id             <chr> "CD_M20172640101", "CD_M20172640102", "CD_M…
#> $ Round.Id             <chr> "CD_R201726401", "CD_R201726401", "CD_R2017…
#> $ Competition.Id       <chr> "CD_S2017264", "CD_S2017264", "CD_S2017264"…
#> $ Venue                <chr> "Ikon Park", "Thebarton Oval", "Victoria Un…
#> $ Local.Start.Time     <dttm> 2017-02-03 19:45:00, 2017-02-04 16:35:00, …
#> $ Round.Number         <int> 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4…
#> $ Round.Abbreviation   <chr> "Rd 1", "Rd 1", "Rd 1", "Rd 1", "Rd 2", "Rd…
#> $ Weather.Type         <chr> "CLEAR_NIGHT", "RAIN", "RAIN", "RAIN", "CLE…
#> $ Weather.Description  <chr> "Clear", "Rain at times", "Partly cloudy", …
#> $ Temperature          <dbl> 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,…
#> $ Home.Team            <chr> "Carlton", "Adelaide Crows", "Western Bulld…
#> $ Home.Goals           <int> 7, 7, 6, 1, 2, 7, 4, 3, 7, 4, 4, 2, 6, 6, 3…
#> $ Home.Behinds         <int> 4, 6, 8, 4, 11, 5, 1, 5, 1, 3, 5, 5, 6, 7, …
#> $ Home.Points          <int> 46, 48, 44, 10, 23, 47, 25, 23, 43, 27, 29,…
#> $ Home.Left.Behinds    <int> 1, 2, 2, 1, 2, 1, 0, 0, 0, 0, 3, 2, 2, 5, 3…
#> $ Home.Right.Behinds   <int> 2, 2, 4, 2, 5, 2, 1, 1, 0, 2, 1, 0, 2, 1, 3…
#> $ Home.Left.Posters    <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0…
#> $ Home.Right.Posters   <int> 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0…
#> $ Home.Rushed.Behinds  <int> 1, 2, 2, 1, 3, 2, 0, 2, 1, 1, 0, 3, 1, 1, 1…
#> $ Home.Touched.Behinds <int> 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…
#> $ Away.Team            <chr> "Collingwood", "GWS Giants", "Fremantle", "…
#> $ Away.Goals           <int> 1, 1, 1, 4, 7, 5, 7, 5, 6, 3, 6, 2, 5, 1, 5…
#> $ Away.Behinds         <int> 5, 6, 6, 1, 6, 4, 2, 6, 7, 5, 7, 2, 6, 3, 2…
#> $ Away.Points          <int> 11, 12, 12, 25, 48, 34, 44, 36, 43, 23, 43,…
#> $ Away.Left.Behinds    <int> 0, 1, 2, 1, 2, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0…
#> $ Away.Right.Behinds   <int> 3, 4, 3, 0, 2, 3, 1, 3, 3, 3, 5, 1, 1, 1, 2…
#> $ Away.Left.Posters    <int> 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 2, 1, 0…
#> $ Away.Right.Posters   <int> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0…
#> $ Away.Rushed.Behinds  <int> 1, 1, 1, 0, 2, 1, 0, 1, 2, 1, 0, 0, 2, 0, 0…
#> $ Away.Touched.Behinds <int> 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0…

Detailed stats

The get_aflw_detailed_data() can be used to return more detailed data than the match data shown above. It takes a vector of match IDs as an argument. For example, let’s say we want detailed stats for the first 10 games in match_data above. Then we would do:

detailed <- get_aflw_detailed_data(first10_ids)
glimpse(detailed)
#> Observations: 10
#> Variables: 191
#> $ Match.Id                                                    <chr> "CD_…
#> $ Round.Id                                                    <chr> "CD_…
#> $ Competition.Id                                              <chr> "CD_…
#> $ away.stats.averages.behinds                                 <dbl> 4.1,…
#> $ away.stats.averages.bounces                                 <dbl> 3.7,…
#> $ away.stats.averages.clangers                                <dbl> 39.7…
#> $ away.stats.averages.clearances.centreClearances             <dbl> 4.9,…
#> $ away.stats.averages.clearances.stoppageClearances           <dbl> 16.9…
#> $ away.stats.averages.clearances.totalClearances              <dbl> 21.7…
#> $ away.stats.averages.contestedMarks                          <dbl> 6.3,…
#> $ away.stats.averages.contestedPossessions                    <dbl> 90.3…
#> $ away.stats.averages.disposalEfficiency                      <dbl> 56.6…
#> $ away.stats.averages.disposals                               <dbl> 167.…
#> $ away.stats.averages.dreamTeamPoints                         <dbl> 843.…
#> $ away.stats.averages.freesAgainst                            <dbl> 13.6…
#> $ away.stats.averages.freesFor                                <dbl> 15.6…
#> $ away.stats.averages.goalAccuracy                            <dbl> 45.7…
#> $ away.stats.averages.goalAssists                             <dbl> 2.6,…
#> $ away.stats.averages.goalEfficiency                          <dbl> 19.5…
#> $ away.stats.averages.goals                                   <dbl> 4.6,…
#> $ away.stats.averages.handballs                               <dbl> 47.9…
#> $ away.stats.averages.hitouts                                 <dbl> 36.6…
#> $ away.stats.averages.inside50s                               <dbl> 23.4…
#> $ away.stats.averages.intercepts                              <dbl> 45.3…
#> $ away.stats.averages.interchangeCounts.interchangeCap        <dbl> 999,…
#> $ away.stats.averages.interchangeCounts.interchangeCountQ1    <dbl> 16, …
#> $ away.stats.averages.interchangeCounts.interchangeCountQ2    <dbl> 14, …
#> $ away.stats.averages.interchangeCounts.interchangeCountQ3    <dbl> 0, 1…
#> $ away.stats.averages.interchangeCounts.interchangeCountQ4    <dbl> 0, 1…
#> $ away.stats.averages.interchangeCounts.totalInterchangeCount <dbl> 30, …
#> $ away.stats.averages.kicks                                   <dbl> 119.…
#> $ away.stats.averages.lastUpdated                             <dttm> 201…
#> $ away.stats.averages.marks                                   <dbl> 39.7…
#> $ away.stats.averages.marksInside50                           <dbl> 6.0,…
#> $ away.stats.averages.metresGained                            <dbl> NA, …
#> $ away.stats.averages.onePercenters                           <dbl> 21.6…
#> $ away.stats.averages.ranking                                 <dbl> NA, …
#> $ away.stats.averages.ratingPoints                            <dbl> NA, …
#> $ away.stats.averages.rebound50s                              <dbl> 18.7…
#> $ away.stats.averages.scoreInvolvements                       <dbl> NA, …
#> $ away.stats.averages.shotEfficiency                          <dbl> 42.7…
#> $ away.stats.averages.shotsAtGoal                             <dbl> 10.0…
#> $ away.stats.averages.superGoals                              <dbl> NA, …
#> $ away.stats.averages.tackles                                 <dbl> 56.6…
#> $ away.stats.averages.tacklesInside50                         <dbl> 7.7,…
#> $ away.stats.averages.totalPossessions                        <dbl> 168.…
#> $ away.stats.averages.turnovers                               <dbl> 47.7…
#> $ away.stats.averages.uncontestedPossessions                  <dbl> 78.6…
#> $ away.stats.totals.behinds                                   <dbl> 5, 6…
#> $ away.stats.totals.bounces                                   <dbl> 3, 0…
#> $ away.stats.totals.clangers                                  <dbl> 37, …
#> $ away.stats.totals.clearances.centreClearances               <dbl> 4, 7…
#> $ away.stats.totals.clearances.stoppageClearances             <dbl> 15, …
#> $ away.stats.totals.clearances.totalClearances                <dbl> 19, …
#> $ away.stats.totals.contestedMarks                            <dbl> 4, 2…
#> $ away.stats.totals.contestedPossessions                      <dbl> 94, …
#> $ away.stats.totals.disposalEfficiency                        <dbl> 52.8…
#> $ away.stats.totals.disposals                                 <dbl> 163,…
#> $ away.stats.totals.dreamTeamPoints                           <dbl> 926,…
#> $ away.stats.totals.freesAgainst                              <dbl> 9, 2…
#> $ away.stats.totals.freesFor                                  <dbl> 20, …
#> $ away.stats.totals.goalAccuracy                              <dbl> 16.7…
#> $ away.stats.totals.goalAssists                               <dbl> 0, 1…
#> $ away.stats.totals.goalEfficiency                            <dbl> 3.7,…
#> $ away.stats.totals.goals                                     <dbl> 1, 1…
#> $ away.stats.totals.handballs                                 <dbl> 48, …
#> $ away.stats.totals.hitouts                                   <dbl> 28, …
#> $ away.stats.totals.inside50s                                 <dbl> 27, …
#> $ away.stats.totals.intercepts                                <dbl> 48, …
#> $ away.stats.totals.interchangeCounts.interchangeCap          <dbl> 0, 0…
#> $ away.stats.totals.interchangeCounts.interchangeCountQ1      <dbl> 0, 0…
#> $ away.stats.totals.interchangeCounts.interchangeCountQ2      <dbl> 0, 0…
#> $ away.stats.totals.interchangeCounts.interchangeCountQ3      <dbl> 0, 0…
#> $ away.stats.totals.interchangeCounts.interchangeCountQ4      <dbl> 0, 0…
#> $ away.stats.totals.interchangeCounts.totalInterchangeCount   <dbl> 0, 0…
#> $ away.stats.totals.kicks                                     <dbl> 115,…
#> $ away.stats.totals.lastUpdated                               <dttm> 201…
#> $ away.stats.totals.marks                                     <dbl> 35, …
#> $ away.stats.totals.marksInside50                             <dbl> 4, 6…
#> $ away.stats.totals.metresGained                              <dbl> NA, …
#> $ away.stats.totals.onePercenters                             <dbl> 23, …
#> $ away.stats.totals.ranking                                   <dbl> NA, …
#> $ away.stats.totals.ratingPoints                              <dbl> NA, …
#> $ away.stats.totals.rebound50s                                <dbl> 18, …
#> $ away.stats.totals.scoreInvolvements                         <dbl> NA, …
#> $ away.stats.totals.shotEfficiency                            <dbl> 22.2…
#> $ away.stats.totals.shotsAtGoal                               <dbl> 6, 1…
#> $ away.stats.totals.superGoals                                <dbl> NA, …
#> $ away.stats.totals.tackles                                   <dbl> 87, …
#> $ away.stats.totals.tacklesInside50                           <dbl> 8, 9…
#> $ away.stats.totals.totalPossessions                          <dbl> 163,…
#> $ away.stats.totals.turnovers                                 <dbl> 57, …
#> $ away.stats.totals.uncontestedPossessions                    <dbl> 69, …
#> $ away.team.teamAbbr                                          <chr> "COL…
#> $ away.team.teamId                                            <chr> "CD_…
#> $ away.team.teamName                                          <chr> "Col…
#> $ away.team.teamNickname                                      <chr> "Mag…
#> $ home.stats.averages.behinds                                 <dbl> 2.7,…
#> $ home.stats.averages.bounces                                 <dbl> 2.1,…
#> $ home.stats.averages.clangers                                <dbl> 38.7…
#> $ home.stats.averages.clearances.centreClearances             <dbl> 4.4,…
#> $ home.stats.averages.clearances.stoppageClearances           <dbl> 15.7…
#> $ home.stats.averages.clearances.totalClearances              <dbl> 20.1…
#> $ home.stats.averages.contestedMarks                          <dbl> 7.4,…
#> $ home.stats.averages.contestedPossessions                    <dbl> 96.1…
#> $ home.stats.averages.disposalEfficiency                      <dbl> 59.6…
#> $ home.stats.averages.disposals                               <dbl> 172.…
#> $ home.stats.averages.dreamTeamPoints                         <dbl> 784.…
#> $ home.stats.averages.freesAgainst                            <dbl> 14.1…
#> $ home.stats.averages.freesFor                                <dbl> 11.9…
#> $ home.stats.averages.goalAccuracy                            <dbl> 50.6…
#> $ home.stats.averages.goalAssists                             <dbl> 3.3,…
#> $ home.stats.averages.goalEfficiency                          <dbl> 23.8…
#> $ home.stats.averages.goals                                   <dbl> 5.6,…
#> $ home.stats.averages.handballs                               <dbl> 60.6…
#> $ home.stats.averages.hitouts                                 <dbl> 27.9…
#> $ home.stats.averages.inside50s                               <dbl> 23.4…
#> $ home.stats.averages.intercepts                              <dbl> 51.0…
#> $ home.stats.averages.interchangeCounts.interchangeCap        <dbl> 999,…
#> $ home.stats.averages.interchangeCounts.interchangeCountQ1    <dbl> 4, 0…
#> $ home.stats.averages.interchangeCounts.interchangeCountQ2    <dbl> 4, 0…
#> $ home.stats.averages.interchangeCounts.interchangeCountQ3    <dbl> 0, 0…
#> $ home.stats.averages.interchangeCounts.interchangeCountQ4    <dbl> 0, 0…
#> $ home.stats.averages.interchangeCounts.totalInterchangeCount <dbl> 8, 0…
#> $ home.stats.averages.kicks                                   <dbl> 111.…
#> $ home.stats.averages.lastUpdated                             <dttm> 201…
#> $ home.stats.averages.marks                                   <dbl> 32.7…
#> $ home.stats.averages.marksInside50                           <dbl> 6.4,…
#> $ home.stats.averages.metresGained                            <dbl> NA, …
#> $ home.stats.averages.onePercenters                           <dbl> 19.7…
#> $ home.stats.averages.ranking                                 <dbl> NA, …
#> $ home.stats.averages.ratingPoints                            <dbl> NA, …
#> $ home.stats.averages.rebound50s                              <dbl> 22.0…
#> $ home.stats.averages.scoreInvolvements                       <dbl> NA, …
#> $ home.stats.averages.shotEfficiency                          <dbl> 47.0…
#> $ home.stats.averages.shotsAtGoal                             <dbl> 11.0…
#> $ home.stats.averages.superGoals                              <dbl> NA, …
#> $ home.stats.averages.tackles                                 <dbl> 49.4…
#> $ home.stats.averages.tacklesInside50                         <dbl> 8.7,…
#> $ home.stats.averages.totalPossessions                        <dbl> 173.…
#> $ home.stats.averages.turnovers                               <dbl> 50.0…
#> $ home.stats.averages.uncontestedPossessions                  <dbl> 77.3…
#> $ home.stats.totals.behinds                                   <dbl> 4, 6…
#> $ home.stats.totals.bounces                                   <dbl> 4, 0…
#> $ home.stats.totals.clangers                                  <dbl> 44, …
#> $ home.stats.totals.clearances.centreClearances               <dbl> 1, 5…
#> $ home.stats.totals.clearances.stoppageClearances             <dbl> 16, …
#> $ home.stats.totals.clearances.totalClearances                <dbl> 17, …
#> $ home.stats.totals.contestedMarks                            <dbl> 7, 5…
#> $ home.stats.totals.contestedPossessions                      <dbl> 106,…
#> $ home.stats.totals.disposalEfficiency                        <dbl> 60.6…
#> $ home.stats.totals.disposals                                 <dbl> 198,…
#> $ home.stats.totals.dreamTeamPoints                           <dbl> 847,…
#> $ home.stats.totals.freesAgainst                              <dbl> 20, …
#> $ home.stats.totals.freesFor                                  <dbl> 9, 2…
#> $ home.stats.totals.goalAccuracy                              <dbl> 58.3…
#> $ home.stats.totals.goalAssists                               <dbl> 4, 3…
#> $ home.stats.totals.goalEfficiency                            <dbl> 28.0…
#> $ home.stats.totals.goals                                     <dbl> 7, 7…
#> $ home.stats.totals.handballs                                 <dbl> 86, …
#> $ home.stats.totals.hitouts                                   <dbl> 30, …
#> $ home.stats.totals.inside50s                                 <dbl> 25, …
#> $ home.stats.totals.intercepts                                <dbl> 56, …
#> $ home.stats.totals.interchangeCounts.interchangeCap          <dbl> 0, 0…
#> $ home.stats.totals.interchangeCounts.interchangeCountQ1      <dbl> 0, 0…
#> $ home.stats.totals.interchangeCounts.interchangeCountQ2      <dbl> 0, 0…
#> $ home.stats.totals.interchangeCounts.interchangeCountQ3      <dbl> 0, 0…
#> $ home.stats.totals.interchangeCounts.interchangeCountQ4      <dbl> 0, 0…
#> $ home.stats.totals.interchangeCounts.totalInterchangeCount   <dbl> 0, 0…
#> $ home.stats.totals.kicks                                     <dbl> 112,…
#> $ home.stats.totals.lastUpdated                               <dttm> 201…
#> $ home.stats.totals.marks                                     <dbl> 26, …
#> $ home.stats.totals.marksInside50                             <dbl> 6, 8…
#> $ home.stats.totals.metresGained                              <dbl> NA, …
#> $ home.stats.totals.onePercenters                             <dbl> 15, …
#> $ home.stats.totals.ranking                                   <dbl> NA, …
#> $ home.stats.totals.ratingPoints                              <dbl> NA, …
#> $ home.stats.totals.rebound50s                                <dbl> 25, …
#> $ home.stats.totals.scoreInvolvements                         <dbl> NA, …
#> $ home.stats.totals.shotEfficiency                            <dbl> 48.0…
#> $ home.stats.totals.shotsAtGoal                               <dbl> 12, …
#> $ home.stats.totals.superGoals                                <dbl> NA, …
#> $ home.stats.totals.tackles                                   <dbl> 59, …
#> $ home.stats.totals.tacklesInside50                           <dbl> 15, …
#> $ home.stats.totals.totalPossessions                          <dbl> 197,…
#> $ home.stats.totals.turnovers                                 <dbl> 47, …
#> $ home.stats.totals.uncontestedPossessions                    <dbl> 91, …
#> $ home.team.teamAbbr                                          <chr> "CAR…
#> $ home.team.teamId                                            <chr> "CD_…
#> $ home.team.teamName                                          <chr> "Car…
#> $ home.team.teamNickname                                      <chr> "Blu…