Womens’ AFL Stats

Oscar Lane 2020-05-23

NOTE - The AFL website for Women’s data has been taken down. This page is left for posterity however these functions no longer work.

Match data

library(fitzRoy)
library(dplyr)

A good thing to check is that the cookie is working. Often this gets changed or moved and without it, the code won’t work.

cookie <- get_aflw_cookie()

print(cookie)

Note - if this is NULL the rest of this Vignette won’t show any outputs but the code will remain!

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

match_data <- get_aflw_match_data()

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)

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:

first10 <- head(match_data, 10)
first10_ids <- first10$Match.Id
first10_ids
detailed <- get_aflw_detailed_data(first10_ids)
glimpse(detailed)