get_players: Retrieve current and historical player data

Description Usage Arguments Details Value Examples

Description

Retrieves current and historical player data from stats.nba.com

Usage

1
get_players(league, season, method = NULL, ...)

Arguments

league

A character value of league, current recognised values are:

'nba'

NBA player info

'd-league

D-League player info

season

Numeric value of the base season, e.g. 2015 for the 2015-2016 season and so on.

method

Optional user-supplied function to retrieve JSON from stats.nba.com

Details

Retrieves basic information about players that stats.nba.com contains in their dataset for a given league and given season. Basic information is the player's current team, and their first and final years in the league and so on. The team_id and person_id values returned should be unique for each team and player respectively, so these are useful keys to other data.

Value

A data.frame with names of current and historical players and the fields

person_id

integer - ID of the player, used in many other datasets

first_name

character - the player's first name

last_name

character - the player's last name

roster_status

logical - currently rostered in the selected season

year_start

integer - year player entered NBA

year_end

integer - year player exited NBA

team_id

integer - ID of the player's team in the season (if roster_status is true)

team_city

character - city of the player's team in the season (if roster_status is true)

team_name

character - name of the player's team in the season (if roster_status is true)

team_abbr

character - abbrev. name of player's team (if roster_status is true)

has_played

logical - did the player record at least one game in NBA at any time (even after the selected season)

Examples

1
2
3
4
5
## Not run: 
    df <- get_players(season=2014, league='d-league')
    tail(df)

## End(Not run)

stephematician/statsnbaR documentation built on May 30, 2019, 3:17 p.m.