Skip to contents

This function aggregates player statistics and play-by-play information within a season by applying player_season_stats(), player_match_stats(), or match_pbp() across groups of teams (for player_season_stats()) or across contests within a season (for player_match_stats() and match_pbp()). For season stats, it aggregates all player data and team data into separate data frames and combines them into a list. For instance, if you want to extract the data from the teams in the women's 2024 Final Four, pass a vector of c("Louisville", "Nebraska", "Penn State", "Pittsburgh") to the function. For match or play-by-play data for a team, pass a single team name and year. Team names can be found in ncaa_teams or by using find_team_name().

Usage

group_stats(
  teams = NULL,
  year = NULL,
  level = "season",
  unique = TRUE,
  sport = "WVB"
)

Arguments

teams

Character vector of team names to aggregate.

year

Numeric vector of years for fall of desired seasons.

level

Character string defining whether to aggregate "season", "match", or play-by-play ("pbp") data.

unique

Logical indicating whether to only process unique contests (TRUE) or whether to process duplicated contests (FALSE). Default is TRUE.

sport

Three letter abbreviation for NCAA sport (must be upper case; for example "WVB" for women's volleyball and "MVB" for men's volleyball).

Value

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.

Note

This function requires internet connectivity as it checks the NCAA website for information.

See also

Other functions that aggregate statistics: conference_stats(), division_stats()

Examples

if (FALSE) { # interactive()
group_stats(teams = c("Louisville", "Nebraska", "Penn St.", "Pittsburgh"),
year = 2024, level = "season")
}