Functions have been added to fitzRoy to scrape and analyse AFLCA coaches votes.
fetch_coaches_votes
- returns all AFLCA coaches votes
for given season/s, round/s, and/or team’s matches.calculate_coaches_vote_possibilities
- returns all
possible breakdowns of coaches votes between two coaches, given a data
frame like the one returned by fetch_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.
season
- the season or seasons to return data from. If
NULL (the default), will return the season that matches
Sys.Date()
round_number
- the round to return data from. If NULL
(the default), will return data from all roundscomp
- the competition to return data from. Must be one
of “AFLM” (default) or “AFLW”. Not all data sources will have AFLW
data.team
- the team/s whose matches to include. If NULL
(the default), will return data from all teams.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).
We can also return votes for AFLW.
We can return just one round instead of the whole fixture.
We could also return coaches votes for matches including a particular team.
Combining these, we can return coaches votes for a single match.
The calculate_coaches_vote_possibilities
function
accepts two arguments.
df
- a data frame which requires column names
Player.Name
, Coaches.Votes
. This can be
returned from the fetch_coaches_votes
function. The votes
can only be from a single match.output_type
- the way to present the results.
"Coach View"
Will provide a list of data frames with
possible votes by coach. "Player View"
will provide a list
of data frames with possible votes by player. See the examples section
for how these data frames look.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.