Skip to contents

load_nba_stats_hustle_player() and load_nba_stats_hustle_team() load the nba_stats_hustle release: eight files per season (leaguehustlestats{player|team}_{season_type}_{per_mode}_{END year}.parquet), contested shots, deflections, charges drawn, screen assists, loose balls and box-outs. The requested season types and per modes (all of them by default) are bound into one frame, with season_type and per_mode columns saying which file a row came from.

Usage

load_nba_stats_hustle_player(
  seasons = most_recent_nba_stats_season(),
  season_type = NULL,
  per_mode = NULL,
  ...,
  dbConnection = NULL,
  tablename = NULL
)

load_nba_stats_hustle_team(
  seasons = most_recent_nba_stats_season(),
  season_type = NULL,
  per_mode = NULL,
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit years – the season's START year (e.g. 2024 for the 2024-25 season). Published coverage starts at 2015 (2015-16). Pass seasons = TRUE for every published season.

season_type

"regular-season" and/or "playoffs"; NULL (the default) reads both.

per_mode

"pergame" and/or "totals"; NULL reads both.

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by DBI::dbConnect()

tablename

The name of the data table within the database

Value

A hoopR_data tibble with one row per player per season type per per mode (load_nba_stats_hustle_player()).

col_nametypesdescription
player_idintegerstats.nba.com player identifier (PERSON_ID); joins to every other nba_stats loader.
player_namecharacterPlayer's full name as stats.nba.com lists it (e.g. 'Nikola Jokic').
team_idintegerstats.nba.com team identifier.
team_abbreviationcharacterTeam tricode (e.g. 'BOS').
agenumericPlayer age in years at the season's reference date, as stats.nba.com reports it.
gintegerGames played in the split.
minnumericMinutes played (per game in 'pergame' files, season total in 'totals' files).
contested_shotsnumericShots the player (or team) contested.
contested_shots_2_ptnumericTwo-point shots contested.
contested_shots_3_ptnumericThree-point shots contested.
deflectionsnumericDeflections of opponent passes or dribbles.
charges_drawnnumericOffensive fouls (charges) drawn.
screen_assistsnumericScreens set that led directly to a teammate's made field goal.
screen_ast_ptsnumericPoints scored on field goals created by the screen assists.
off_loose_balls_recoverednumericLoose balls recovered on offense.
def_loose_balls_recoverednumericLoose balls recovered on defense.
loose_balls_recoverednumericLoose balls recovered (offense plus defense).
pct_loose_balls_recovered_offnumericShare (0-1) of loose-ball recoveries made on offense.
pct_loose_balls_recovered_defnumericShare (0-1) of loose-ball recoveries made on defense.
off_boxoutsnumericBox-outs on offense.
def_boxoutsnumericBox-outs on defense.
box_outsnumericBox-outs executed (offense plus defense).
box_out_player_team_rebsnumericRebounds secured by the player's team on the player's box-outs.
box_out_player_rebsnumericRebounds secured by the player himself on his own box-outs.
pct_box_outs_offnumericShare (0-1) of box-outs made on offense.
pct_box_outs_defnumericShare (0-1) of box-outs made on defense.
pct_box_outs_team_rebnumericShare (0-1) of the player's box-outs that ended in a team rebound.
pct_box_outs_rebnumericShare (0-1) of the player's box-outs that ended in his own rebound.
seasonintegerEND year of the NBA season (2025 = 2024-25) – the published asset's own stamp, one more than the seasons argument.
season_typecharacterSeason type of the source file: 'regular-season' or 'playoffs' (the release file-name token).
per_modecharacterAggregation of the source file: 'pergame' (per-game averages) or 'totals' (season totals); stamped from the file name when the rows lack it.

A hoopR_data tibble with one row per team per season type per per mode (load_nba_stats_hustle_team()).

col_nametypesdescription
team_idintegerstats.nba.com team identifier.
team_namecharacterTeam nickname (e.g. 'Celtics').
minnumericMinutes played (per game in 'pergame' files, season total in 'totals' files).
contested_shotsnumericShots the team contested.
contested_shots_2_ptnumericTwo-point shots contested.
contested_shots_3_ptnumericThree-point shots contested.
deflectionsnumericDeflections of opponent passes or dribbles.
charges_drawnnumericOffensive fouls (charges) drawn.
screen_assistsnumericScreens set that led directly to a teammate's made field goal.
screen_ast_ptsnumericPoints scored on field goals created by the screen assists.
off_loose_balls_recoverednumericLoose balls recovered on offense.
def_loose_balls_recoverednumericLoose balls recovered on defense.
loose_balls_recoverednumericLoose balls recovered (offense plus defense).
pct_loose_balls_recovered_offnumericShare (0-1) of loose-ball recoveries made on offense.
pct_loose_balls_recovered_defnumericShare (0-1) of loose-ball recoveries made on defense.
off_boxoutsnumericBox-outs on offense.
def_boxoutsnumericBox-outs on defense.
box_outsnumericBox-outs executed (offense plus defense).
pct_box_outs_offnumericShare (0-1) of box-outs made on offense.
pct_box_outs_defnumericShare (0-1) of box-outs made on defense.
seasonintegerEND year of the NBA season (2025 = 2024-25) – the published asset's own stamp, one more than the seasons argument.
season_typecharacterSeason type of the source file: 'regular-season' or 'playoffs' (the release file-name token).
per_modecharacterAggregation of the source file: 'pergame' (per-game averages) or 'totals' (season totals); stamped from the file name when the rows lack it.

Examples

# \donttest{
  try(load_nba_stats_hustle_player(seasons = most_recent_nba_stats_season(),
                                   season_type = "regular-season", per_mode = "totals"))
#> ───────────────────────────────────────────────────────────────── hoopR 3.2.0 ──
#> # A tibble: 481 × 31
#>    player_id player_name      team_id team_abbreviation   age     g   min
#>        <int> <chr>              <int> <chr>             <dbl> <int> <dbl>
#>  1   1643407 AJ Dybantsa   1610612764 WAS                  19    17   585
#>  2   1631260 AJ Green      1610612749 MIL                  27    21   334
#>  3   1642358 AJ Johnson    1610612740 NOP                  22     4    25
#>  4    203932 Aaron Gordon  1610612743 DEN                  31    19   547
#>  5   1630174 Aaron Nesmith 1610612754 IND                  27    19   535
#>  6   1630598 Aaron Wiggins 1610612737 ATL                  27    21   528
#>  7   1642846 Ace Bailey    1610612762 UTA                  20    22   669
#>  8   1643530 Aday Mara     1610612760 OKC                  21    17   378
#>  9   1641737 Adem Bona     1610612755 PHI                  23    15   224
#> 10   1642876 Adou Thiero   1610612747 LAL                  22     7    56
#> # ℹ 471 more rows
#> # ℹ 24 more variables: contested_shots <int>, contested_shots_2_pt <int>,
#> #   contested_shots_3_pt <int>, deflections <int>, charges_drawn <int>,
#> #   screen_assists <int>, screen_ast_pts <int>,
#> #   off_loose_balls_recovered <int>, def_loose_balls_recovered <int>,
#> #   loose_balls_recovered <int>, pct_loose_balls_recovered_off <dbl>,
#> #   pct_loose_balls_recovered_def <dbl>, off_boxouts <int>, …
# }