team_game_logs: Retrieve team game logs

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
team_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

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

Details

This function returns a set of measurements of a team for each game in a given league, season and season_type which indicates whether to query the regular season, playoffs, allstar game or preseason. All games will be returned twice, one for the home team entry and the other for the away team.

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

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

Value

A data.frame containing the data for each game and team 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

team_id

integer - unique identifier of the team

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 the team (true) or loss (false)

mins

numeric - minutes the team played on court in game

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

See Also

player_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.