player_game_logs: Retrieve player game logs

Description Usage Arguments Details Value See Also Examples

Description

Retrieves all player game logs from stats.nba.com for a given season and league.

Usage

1
player_game_logs(league, season, season_type, method = NULL, ...)

Arguments

league

A character value of league e.g. 'nba', 'd-league'.

season

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

season_type

A character value for the type of season, valid types are regular, allstar, playoffs and preseason.

method

The function to use for retrieving data, must accept two arguments, url and headers .....

...

Further arguments to pass on to the method function.

Details

This function returns a set of player measurements for each game in a given league, season and season_type which indicates whether to query the regular season, playoffs, allstar game or preseason.

Each game returned has a unique game_id which can be used for queries to play-by-play or shot-chart datasets.

The player statistics returned are given as total values for the game.

Value

A data.frame containing the data for each game and each player with columns converted to the data types specified by statsnbaR's internal YAML.

game_season

integer - an id code for the season, e.g. 22015 for the 2015-16 regular season, 12015 for the pre-season and so forth

person_id

integer - ID of the player

player_name

character - the player's first and last name

team_abbr

character - abbrev. name of the team

team_name

character - name of team that player belonged to in the game

game_id

numeric - unique numeric identifier of the game

game_date

date - date game was played (or scheduled)

game_at_home

logical - home (true) or away game (false)

win

logical - win for player (true) or loss (false)

mins

numeric - minutes player was on court in game

All other returned columns are described in the glossary provided at http://stats.nba.com/help/glossary.

See Also

team_game_logs http://stats.nba.com/help/glossary

Examples

1
2
3
4
5
6
7
## Not run: 
    df <- player_game_logs(league='nba',
                           season=2013,
                           season_type='playoffs')
    tail(df)

## End(Not run)

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