Estimating NRL finals probabilities with Monte Carlo simulation
My submission is from a sports analytics side project I did earlier in the year that estimated the probability of National Rugby League (NRL) teams qualifying for the finals based on how many matches they won during the regular season. I simulated 10,000 seasons using a Monte Carlo approach. The full post and methodology is available on my site.
- Summarised results from my analysis (
nrl_simulated_finals_probabilities.csv)
- gt: Core table creation and formatting
- gtExtras: Additional features e.g. stacked bar chart
- tidyverse: General data manipulation and transformation
- Custom styling: FiveThirtyEight theme with custom fonts and colours
create_table.R # Table creation script
nrl_simulated_finals_probabilities.csv # Data
table.html # Generated HTML output
table.png # Static image version
renv.lock # Package management
This project uses renv for package management to ensure consistent results across different environments.
- R version 4.4.0 or higher (this project was developed with R 4.4.0)
- Git (to clone the repository)
-
Clone the repository
git clone https://github.com/mitchhenderson/2025-Table-Content cd 2025-Table-Contest -
Restore the package environment
# Install renv if not already installed if (!requireNamespace("renv", quietly = TRUE)) { install.packages("renv") } # Restore all project dependencies renv::restore()
This will automatically install all required packages (gt, gtExtras, tidyverse, etc.) at the exact versions I used.
-
Run the script
source("create_table.R")
After running the script, table.html will be generated containing an HTML version of the table.
The table object will also be available in your R environment and display in the Viewer pane of Positron or RStudio.
Created for the 2025 Table Contest using R, gt, and gtExtras
