This function aggregates player statistics and play-by-play information
within a season by applying team_match_stats(), player_season_stats(), player_match_stats(),
or match_pbp() across groups of teams (for player_season_stats()) or
across contests within a season (for team_match_stats(),
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().
group_stats(
teams = NULL,
year = NULL,
level = "teamseason",
unique = TRUE,
sport = "WVB",
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.
Character vector of team names to aggregate.
Numeric vector of years for fall of desired seasons.
Character string defining whether to aggregate "teamseason", "teammatch", "playermatch", or match play-by-play ("pbp") data.
Logical indicating whether to only process unique contests (TRUE) or whether to process duplicated contests (FALSE). Default is TRUE.
Three letter abbreviation for NCAA sport (must be upper case; for example "WVB" for women's volleyball and "MVB" for men's volleyball).
Numeric for time delay between teams/contests in seconds.
Other functions that aggregate statistics:
conference_stats(),
division_stats()
if (FALSE) { # interactive()
group_stats(teams = c("Louisville", "Nebraska", "Penn St.", "Pittsburgh"),
year = 2024, level = "teamseason")
}
Run the code above in your browser using DataLab