Score-worms

not_cran <- identical(Sys.getenv("NOT_CRAN"), "true")
online <- !is.null(curl::nslookup("r-project.org", error = FALSE))
eval_param <- not_cran & online

knitr::opts_chunk$set(
  eval = eval_param,
  message = FALSE,
  warning = FALSE,
  collapse = TRUE,
  comment = "#>"
)

library(fitzRoy)
library(dplyr)

Functions have been added to fitzRoy to plot and analyse AFL score worms

Working with score worms

The plot_score_worm, plot_score_worm, and plot_score_worm functions accepts the argumentmatch_id to fetch the plot/data for a given match.

Examples

The following are some examples of ways to plot and scrape the score worm data.

Fist we can plot the score worm for the 2024 round 20 game between Fremantle and West Coast.

plot_score_worm('CD_M20240142004') 

We can also plot the total scores of each team throughout the game.

plot_score_worm_totals('CD_M20240142004') 

We can also just return the data for the fixture that can be used to construct these plots or for other score analysis.

fetch_score_worm_data('CD_M20240142004')

We can return multiple games worth of data by passing in a vector of match_ids.

fetch_score_worm_data(c('CD_M20240142101','CD_M20240142102','CD_M20240142103'))


Try the fitzRoy package in your browser

Any scripts or data that you put into this service are public.

fitzRoy documentation built on April 3, 2025, 10:30 p.m.