| group_stats | R Documentation |
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
)
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 "teamseason", "teammatch", "playermatch", or match 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). |
delay |
Numeric for time delay between teams/contests in seconds. |
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.
This function requires internet connectivity as it checks the
NCAA website for information.
It also uses the {chromote} package
and requires Google Chrome to be
installed.
Other functions that aggregate statistics:
conference_stats(),
division_stats()
group_stats(teams = c("Louisville", "Nebraska", "Penn St.", "Pittsburgh"),
year = 2024, level = "teamseason")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.