This is a wrapper around group_stats() that extracts season, match, or pbp
data from players in all teams in the chosen division. For season stats,
it aggregates all player data and team data into separate data frames and
combines them into a list. For match and pbp stats, it aggregates into a
data frame.
division_stats(
year = NULL,
division = 1,
level = NULL,
sport = "WVB",
save = FALSE,
path = ".",
delay = 2
)For season level, returns list with data frames of player statistics and team statistics. For match and pbp levels, returns data frame of player statistics and play-by-play information respectively.
Numeric vector of years for fall of desired seasons.
NCAA division (must be 1, 2, or 3).
Character string defining whether to aggregate "teamseason", "teammatch", "playermatch", or match play-by-play ("pbp") data.
Three letter abbreviation for NCAA sport (must be upper case; for example "WVB" for women's volleyball and "MVB" for men's volleyball).
Logical for whether to save the statistics locally as CSVs (default FALSE).
Character string of path to save statistics files.
Numeric for time delay between teams/contests in seconds.
Note: Changes to the NCAA website have made large-scale scraping unstable, and can trigger IP address blocks when there are lots of requests. This function seems to trigger these blocks frequently now, so use caution when scraping large amounts of data.
Other functions that aggregate statistics:
conference_stats(),
group_stats()
if (FALSE) { # interactive()
division_stats(year = 2024, division = 1, level = "teamseason")
}
Run the code above in your browser using DataLab