View source: R/do_possession_stats.R
| do_possession_stats | R Documentation |
Compute the possessions-related statistics for teams. These statistics are offensive rating, defensive rating, net rating, pace and number of possessions.
do_possession_stats(data_possess, season = "2025-2026")
data_possess |
Data frame with the beginning of each possession
obtained with |
season |
Season string. |
See https://www.basketball-reference.com/about/glossary.html for formulas and explanations.
Both teams in the same game share the same pace. Pace reflects the tempo of the game itself, not just one team's style. Over many games, a team's average pace reflects how fast they usually play, but any individual game's pace is shared with their opponent.
A data frame with the possessions statistics for each team.
Guillermo Vinue
do_possession
## Not run:
library(dplyr)
df0 <- acb_vbc_cz_pbp_2223
day_num <- unique(acb_vbc_cz_pbp_2223$day)
game_code <- unique(acb_vbc_cz_pbp_2223$game_code)
# Starting players:
acb_games_2223_sl <- acb_vbc_cz_sl_2223 %>%
dplyr::filter(period == "1C")
# Prepare data:
df1 <- do_prepare_data(df0, day_num,
acb_games_2223_sl, acb_games_2223_info,
game_code)
teams_game <- sort(unique(df1$team))
# Study the lineups:
data_res <- do_study_lineup(df1, day_num, game_code_num, teams_game[1], FALSE)
data_all_posse <- data_res$data_pos %>% select(-row_num)
# Statistics of possessions:
data_poss_st <- do_possession_stats(data_all_posse, "2022-2023")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.