filter_per_player: Generate filters for a 'per player' data query.

Description Usage Arguments Details Value See Also

Description

Creates a list of key-value pairs from the supplied arguments for use in per_player_agg, and inserts default values for any filters not specified in the arguments.

Usage

1

Arguments

...

List of key-value pairs to use as filters in a query to the per-player data endpoint of stats.nba.com. The recognised filters are described here with their default values indicated in brackets:

college

character - full name of college of player (all)

conference

character - conference of player: 'both', 'west', 'east' ('both')

country

character - nationality of players (all)

date_from

date - include games from this date: (null)

date_to

date - include games until this date: (null)

division

character - division of players: 'all', 'atlantic', 'central', 'north_west', 'pacific', 'south_east', 'south_west' ('all')

draft_pick

character - draft status of players: 'all', 'first_round', 'second_round', 'first_pick', 'lottery' ('all')

draft_year

integer - year players were drafted: (null)

experience

character - experience level of players: 'all', 'rookie', 'sophomore', 'veteran' ('all')

game_segment

character - segment of game included: 'full_game', 'first_half', 'second_half', 'overtime' ('full_game')

height_segment

character - filter player heights, 'lt_six' means < six feet tall, while gte_six means >= six feet tall : 'all', 'lt_six', 'gte_six', 'lt_six_four', 'gte_six_four', 'lt_six_seven', 'gte_six_seven', 'lt_six_ten', 'gte_six_ten', 'lt_seven', 'gte_seven' ('all')

last_n

integer - number of last games to include up to 15 (null)

league

character - league of players: 'NBA', 'D-league' ('NBA')

location

character - select home or away games: 'both', 'home', 'away', ('all')

month

character - three letter abbrevation of month of games to include: ('all')

opponent_conference
opponent_division
opponent_team

integer - team_id of game opponent: (null)

playoff_round

integer - playoff round to include, 0 is for regular season games, 1 is for the first round, 4 is the NBA finals (0)

pace_adjust

logical - pace adjustment? (FALSE)

per

character - units of return values: 'total', 'game', 'possessions_100', 'plays_100', 'possession', 'play', 'minute', 'minutes_48', 'minutes_40', 'minutes_36', 'inverse_minutes' ('total')

period

integer - quarter to include 0 is all, or 1–4 for individual quarters

position

character - position of players: 'all', 'center', 'forward', 'guard' ('all')

plus_minus

logical - differential to overall values? (FALSE)

rank

logical - rank results? (FALSE)

season

numeric - integer year of season to retrieve, e.g. 2014 for the 2014-15 season

season_segment

character - games to include by season segment: 'all', 'pre_allstar', 'post_allstar' ('all')

season_type

character - games to include by season type: 'allstar', 'playoff', 'regular', 'preseason' ('regular')

shot_clock

character - shot clock values of plays to include, segmented into all values, then 24–22, 22–18, 18–15, 15–7, 4–7 and 4–0 seconds and Off: 'all', 'super_early', 'very_early', 'early', 'average', 'late', 'very_late', 'off' ('all')

starting_status

character - starting status of player in games: 'all', 'bench', 'starter' ('all')

team_id

integer - id of team to include (0)

weight_segment

character - filter players weights 'lt_200' means < 200 lbs while 'gte200' means >= 200lbs : 'all', 'lt_200', 'gte_200', 'lt_225', 'gte_225', 'lt_250', 'gte_250', 'lt_275', 'gte_275', 'lt_300', 'gte_300' ('all')

win_loss

character - win or loss filter: 'all', 'win', 'loss' ('all')

Details

Returns a named list of key-value pairs which are given either by the arguments to the function, or by default values specified by statnbaR internal YAML data. Ensures that all the filters specified have been assigned a value.

Value

A list of key-value pairs for passing to the per-player data query function per_player_agg with argument clutch=FALSE.

See Also

per_player_agg


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