| Title: | Functions to Scrape Rugby Data |
|---|---|
| Description: | Provides a set of functions to scrape and analyze rugby data. Supports competitions including the National Rugby League, New South Wales Cup, Queensland Cup, Super League, and various representative and women's competitions. Includes functions to fetch player statistics, match results, ladders, venues, and coaching data. Designed to assist analysts, fans, and researchers in exploring historical and current rugby league data. See Woods et al. (2017) <doi:10.1123/ijspp.2016-0187> for an example of rugby league performance analysis methodology. |
| Authors: | Daniel Tomaro [aut, cre] |
| Maintainer: | Daniel Tomaro <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-06-08 10:53:27 UTC |
| Source: | https://github.com/danieltomaro13/nrlr |
Retrieves the list of competitions from Champion Data MC API.
fetch_cd_comps()fetch_cd_comps()
A tibble containing competition details.
Fetch Rugby League Coaches (main wrapper)
fetch_coaches( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )fetch_coaches( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )
season |
Integer. Season year (from 1998). |
league |
Character. One of: "nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup". |
source |
Character. Only "rugbyleagueproject" is currently supported. |
A tibble of coach details.
fetch_coaches(2024, league = "nrl")fetch_coaches(2024, league = "nrl")
fetch_fixture returns the Fixture for a given NRL Round. Internally, it calls a fetch_fixture_* function depending on the source.
By default it uses "NRL", but can be extended later to other sources.
fetch_fixture( season = NULL, round_number = NULL, comp = 111, source = "NRL", ... ) fetch_fixture_nrl(season = NULL, round_number = NULL, comp = 111)fetch_fixture( season = NULL, round_number = NULL, comp = 111, source = "NRL", ... ) fetch_fixture_nrl(season = NULL, round_number = NULL, comp = 111)
season |
Numeric. Season year (e.g. 2025). |
round_number |
Numeric. Round number (e.g. 4). |
comp |
Competition id, default 111 for Telstra NRL Premiership. |
source |
Source of the data ("NRL"). |
... |
Additional arguments passed to source-specific functions. |
A tibble with the fixture.
## Not run: fetch_fixture(2025, 4) fetch_fixture(2025, 18, source = "NRL") ## End(Not run)## Not run: fetch_fixture(2025, 4) fetch_fixture(2025, 18, source = "NRL") ## End(Not run)
'fetch_injuries_suspensions' retrieves injury and suspension data for the NRL. It supports multiple data sources via the 'source' parameter.
fetch_injuries_suspensions(source = "zerotackle", ...)fetch_injuries_suspensions(source = "zerotackle", ...)
source |
Character. Source of the data. Currently only '"zerotackle"' is supported. |
... |
Additional arguments passed to source-specific functions. |
A tibble with columns: team, player, reason, expected_return.
## Not run: fetch_injuries_suspensions() ## End(Not run)## Not run: fetch_injuries_suspensions() ## End(Not run)
Scrapes Zero Tackle's NRL Injuries & Suspensions page and returns a tidy tibble.
fetch_injuries_suspensions_zerotackle()fetch_injuries_suspensions_zerotackle()
A tibble with columns: team, player, reason, expected_return.
Fetches ladder standings for a given season and league from a specified source.
fetch_ladder( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject", "nrl") )fetch_ladder( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject", "nrl") )
season |
Integer. Season year (1998 or later). |
league |
Character. One of: "nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup". |
source |
Character. Either "rugbyleagueproject" or "nrl". |
A tibble with ladder standings and statistics.
fetch_ladder(2025, league = "nrl", source = "nrl") fetch_ladder(2024, league = "super_league")fetch_ladder(2025, league = "nrl", source = "nrl") fetch_ladder(2024, league = "super_league")
Retrieves the NRL ladder (standings) for a specified season and optionally round.
fetch_ladder_nrl(season, round_number = NULL, comp = 111)fetch_ladder_nrl(season, round_number = NULL, comp = 111)
season |
Integer scalar. Season year (e.g. 2025). |
round_number |
Integer scalar or NULL. Round number (e.g. 4). If NULL, fetches current ladder. |
comp |
Integer scalar. Competition ID (default 111 for Telstra Premiership). |
A tibble with ladder positions and stats.
Fetches NRL team lineups from nrl.com for a given round using a direct URL. Prints a simple CLI message about the URL being fetched.
fetch_lineups(url, source = "nrl.com", type = "team_list")fetch_lineups(url, source = "nrl.com", type = "team_list")
url |
Character. The full URL to the team list page on nrl.com. |
source |
Character. Currently only "nrl.com" is supported. |
type |
Character. Currently only "team_list". |
A tibble with game, first_name, last_name, team, role.
fetch_lineups(url = "https://www.nrl.com/news/2024/05/07/nrl-team-lists-round-10/")fetch_lineups(url = "https://www.nrl.com/news/2024/05/07/nrl-team-lists-round-10/")
Unified wrapper to fetch player stats from either Champion Data MC API (NRL/NRLW/State of Origin) or Rugby League Project web scraping.
fetch_player_stats( season = NULL, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup"), round = NULL, comp = NULL, source = c("championdata", "rugbyproject") )fetch_player_stats( season = NULL, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup"), round = NULL, comp = NULL, source = c("championdata", "rugbyproject") )
season |
Integer scalar. Season year (rugbyproject only). |
league |
Character scalar. League name (rugbyproject only). |
round |
Integer scalar or NULL. Round number filter (both sources). |
comp |
Integer. Competition ID (championdata only). |
source |
Character scalar. One of "championdata" or "rugbyproject". Default is "championdata". |
For 'source = "championdata"', provide 'comp' (competition ID). 'round' is optional. For 'source = "rugbyproject"', provide 'season', 'league', and optionally 'round'.
A tibble of player stats joined with fixture info.
Fetches player stats for the given Champion Data competition ID. Use fetch_cd_competitions for all ids. If round is provided, filters fixtures to that round. Otherwise fetches all completed matches available.
fetch_player_stats_championdata(comp, round = NULL)fetch_player_stats_championdata(comp, round = NULL)
comp |
Integer. Competition ID (required). |
round |
Integer or NULL. Round filter (optional). |
Tibble of player stats joined with fixture info.
Main wrapper to fetch match results for one or more seasons.
fetch_results( seasons, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )fetch_results( seasons, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )
seasons |
Integer vector. One or more seasons to fetch (1998 or later). |
league |
Character. League name. See options. |
source |
Character. Data source; only "rugbyleagueproject" currently supported. |
A tibble of match results with parsed date and round.
Fetch Rugby League Match Results from Rugby League Project
fetch_results_rugbyproject(seasons, league)fetch_results_rugbyproject(seasons, league)
seasons |
Integer vector. One or more seasons to fetch (1998 or later). |
league |
Character. League name. See options. |
A tibble of match results with parsed date, aligned to weekday, and round.
Fetches team stats for the given Champion Data competition ID. If round is provided, filters fixtures to that round.
fetch_team_stats_championdata(comp, round = NULL)fetch_team_stats_championdata(comp, round = NULL)
comp |
Integer. Competition ID (required). |
round |
Integer or NULL. Round filter (optional). |
Tibble of team stats joined with fixture info.
Fetch Rugby League Venues (main wrapper)
fetch_venues( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )fetch_venues( season, league = c("nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup"), source = c("rugbyleagueproject") )
season |
Integer. Season year (from 1998). |
league |
Character. One of: "nrl", "super_league", "championship", "league_one", "womens_super_league", "qld_cup", "nsw_cup", "state_of_origin", "challenge_cup", "1895_cup". |
source |
Character. Only "rugbyleagueproject" is currently supported. |
A tibble of venue details.
fetch_venues(2024, league = "nrl")fetch_venues(2024, league = "nrl")