nba_per_minutes: *Scale Box-Score Counting Stats Per N Minutes*

View source: R/nba_scaling.R

nba_per_minutesR Documentation

Scale Box-Score Counting Stats Per N Minutes

Description

Rescale counting stats to a per-minute basis (defaults to the familiar per-36). Adds one "{col}_per_{per}" column per requested stat; the original columns are left untouched.

Usage

nba_per_minutes(df, cols, minutes = "min", per = 36)

Arguments

df

A data frame / tibble of box-score rows.

cols

Character vector of counting-stat columns to rescale (e.g. c("pts", "reb", "ast")).

minutes

Name of the minutes column. Defaults to "min".

per

Minutes to scale to. Defaults to 36.

Value

df with the added per-minute columns.

See Also

Other Basketball Analytics Utilities: espn_basketball_player_core(), nba_add_advanced_metrics(), nba_assist_pct(), nba_assist_to_turnover(), nba_defensive_rating(), nba_effective_fg_pct(), nba_four_factors(), nba_ft_rate(), nba_game_score(), nba_net_rating(), nba_offensive_rating(), nba_oreb_pct(), nba_pace(), nba_per_possessions(), nba_possessions(), nba_true_shooting_pct(), nba_turnover_pct(), nba_usage_rate()

Examples

box <- data.frame(player = c("A", "B"), min = c(36, 24),
                  pts = c(18, 8), reb = c(9, 6), ast = c(7, 2))
nba_per_minutes(box, cols = c("pts", "reb", "ast"))

hoopR documentation built on Aug. 25, 2026, 9:07 a.m.