AFLCA Coaches Votes Functions

Functions have been added to fitzRoy to scrape and analyse AFLCA coaches votes.

Scraping Coaches Votes

The fetch_coaches_votes function accepts 4 arguments. The season, round_number and comp arguments are common to the core fetch_* functions as per the Main Fetch Functions Vignette.

Examples

The following are some examples of ways to scrape the AFLCA coaches votes. Firstly, coaches votes can be retrieved for a season (or an array of seasons).

fetch_coaches_votes(season = 2021, comp = "AFLM") %>% head()

We can also return votes for AFLW.

fetch_coaches_votes(season = 2021, comp = "AFLW") %>% head()

We can return just one round instead of the whole fixture.

fetch_coaches_votes(season = 2021, round_number = 24, comp = "AFLM")
fetch_coaches_votes(season = 2021, round_number = 9, comp = "AFLW")

We could also return coaches votes for matches including a particular team.

fetch_coaches_votes(season = 2021, comp = "AFLM", team = "Western Bulldogs")
fetch_coaches_votes(season = 2021, comp = "AFLW", team = "Western Bulldogs")

Combining these, we can return coaches votes for a single match.

fetch_coaches_votes(season = 2021, round_number = 24, comp = "AFLM", team = "Western Bulldogs")
fetch_coaches_votes(season = 2021, round_number = 9, comp = "AFLW", team = "Western Bulldogs")

Calculating Coaches Vote Possibilities

The calculate_coaches_vote_possibilities function accepts two arguments.

Examples

The following code will return the coaches votes for a particular match, then find the possible coaches vote breakdowns.

df <- fetch_coaches_votes(season = 2021, round_number = 24, comp = "AFLM", team = "Western Bulldogs")
calculate_coaches_vote_possibilities(df, "Coach View")

The following code will create a data frame manually, then find the possible coaches vote breakdowns.

df <- data.frame(
                Player.Name = c("Tom Liberatore","Jack Macrae","Marcus Bontempelli","Cody Weightman","Darcy Parish","Aaron Naughton","Jordan Ridley"),
                Coaches.Votes = c(7, 6, 5, 5, 4, 2, 1)
)
calculate_coaches_vote_possibilities(df, "Player View")