Skip to contents

Loads the espn_nba_depthcharts release: daily snapshots of every NBA team's ESPN depth chart, one row per athlete per depth-chart slot per snapshot date (as_of_date), with the slot's position and the athlete's depth_rank in it. The tag holds the current season only (2027 = 2026-27, the first season captured), as parquet.

Usage

load_nba_depthcharts(
  seasons = most_recent_nba_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit season-ending years (2027 = 2026-27), like the other ESPN load_nba_*() loaders. Published coverage starts at 2027. Pass seasons = TRUE for every published season.

...

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 athlete per depth-chart slot per snapshot date.

col_nametypesdescription
as_of_dateDateDate of the daily snapshot the row comes from.
leaguecharacterLeague slug ('nba').
seasonintegerSeason END year (2027 = 2026-27).
season_typeintegerESPN season type of the snapshot: 1 preseason, 2 regular season, 3 postseason.
team_idintegerESPN team identifier.
team_display_namecharacterFull team display name (e.g. 'Boston Celtics').
team_abbreviationcharacterESPN team abbreviation (e.g. 'BOS').
group_idintegerESPN depth-chart group id (one group, 'Depth Chart', for the NBA).
group_namecharacterESPN depth-chart group name ('Depth Chart').
position_slotcharacterDepth-chart slot key, the lowercase position abbreviation (e.g. 'pg', 'c').
position_idintegerESPN position id of the slot.
position_abbreviationcharacterPosition abbreviation of the slot (e.g. 'PG', 'C').
position_namecharacterPosition name of the slot (e.g. 'Point Guard', 'Center').
depth_rankintegerThe athlete's place in the slot: 1 = starter, 2 = first backup, and so on.
athlete_idintegerESPN athlete identifier.
athlete_display_namecharacterAthlete display name (full).
athlete_short_namecharacterAthlete short display name.
espn_timestampcharacterESPN's last-updated time of the team's depth chart (UTC, ISO 8601 text).

See also

Other hoopR Loader Functions: load_mbb_pbp(), load_nba_pbp()

Examples

# \donttest{
  try(load_nba_depthcharts(seasons = most_recent_nba_season()))
#> ───────────────────────────────────────────────────────────────── hoopR 3.2.0 ──
#> # A tibble: 65,887 × 18
#>    as_of_date league season season_type team_id team_display_name
#>    <date>     <chr>   <int>       <int>   <int> <chr>            
#>  1 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  2 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  3 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  4 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  5 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  6 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  7 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  8 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#>  9 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#> 10 2026-09-08 nba      2027           1       1 Atlanta Hawks    
#> # ℹ 65,877 more rows
#> # ℹ 12 more variables: team_abbreviation <chr>, group_id <int>,
#> #   group_name <chr>, position_slot <chr>, position_id <int>,
#> #   position_abbreviation <chr>, position_name <chr>, depth_rank <int>,
#> #   athlete_id <int>, athlete_display_name <chr>, athlete_short_name <chr>,
#> #   espn_timestamp <chr>
# }