Learn R Programming

BAwiR (version 1.4.2)

do_possession_stats: Possessions-related statistics

Description

Compute the possessions-related statistics, namely, offensive rating, defensive rating, net rating, pace and number of possessions.

Usage

do_possession_stats(data_possess, season = "2025-2026")

Value

A data frame with the possessions statistics for each team.

Arguments

data_possess

Data frame with the beginning of each possession obtained with do_possession.

season

Season string.

Author

Guillermo Vinue

Details

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.

See Also

do_possession

Examples

Run this code
if (FALSE) {
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)

acb_games_2223_sl <- acb_vbc_cz_sl_2223 %>%
  filter(period == "1C")

df1 <- do_prepare_data(df0, day_num, 
                       acb_games_2223_sl, acb_games_2223_info,
                       game_code)
                       
df2 <- do_possession(df1, "1C")    

do_possession_stats(df2, "2022-2023")
}

Run the code above in your browser using DataLab