Skip to contents

A tidy player dictionary (id, name, team, bio, headshot URL) sourced from the stats.nba.com player index. Handy for joining player ids to names/teams and for fetching headshots.

Usage

nba_player_dict(season = year_to_season(most_recent_nba_season() - 2), ...)

Arguments

season

Season in "YYYY-YY" form. Defaults to the previous season, year_to_season(most_recent_nba_season() - 2) (the current season rolls over in October).

...

Additional arguments passed to nba_playerindex() (e.g. proxy).

Value

A hoopR_data tibble with one row per player:

col_nametypesdescription
player_idcharacterPlayer id (PERSON_ID).
player_namecharacterFull name.
player_slugcharacterURL-safe player slug.
team_idcharacterTeam id.
team_abbreviationcharacterTeam abbreviation.
team_namecharacterFull team name.
positioncharacterListed position.
jersey_numbercharacterJersey number.
heightcharacterListed height.
weightcharacterListed weight.
countrycharacterCountry.
draft_yearcharacterDraft year.
from_yearcharacterFirst season.
to_yearcharacterMost recent season.
headshot_urlcharacterNBA CDN headshot URL.
seasoncharacterSeason (echoes the season argument).

See also

Examples

if (FALSE) { # interactive()
# \donttest{
  try(nba_player_dict())
# }
}