Description Usage Arguments Details Value See Also Examples
Retrieve the aggregated data for each player from stats.nba.com
1 2 | per_player_agg(filters = filter_per_player(), clutch = FALSE,
measurement = "base", method = NULL, ...)
|
filters |
A named list of key-value filters constructed by either
|
clutch |
A logical value indicating whether to extract the ‘clutch’ data, i.e. to only include plays that occurred during ‘clutch’ time in the aggregation. |
measurement |
A character string representing the desired dataset
|
method |
Optional user-supplied function to retrieve JSON from stats.nba.com |
Collects player 'play' statistics as averages or other aggregates over games in different units such as total values, per game values, per possession values and so forth.
The statistics are grouped into various categories which are determined
by the value of the measurement
argument. The categories are
‘base’, ‘advanced’, ‘miscellaneous’, ‘scoring’
and ‘usage’.
The query filters are constructed by either filter_per_player
if
clutch=FALSE
or filter_per_player_clutch
if
clutch=TRUE
. The list of potential filters are documented in those
functions. The units that the values/data is aggregated into is determined
by the per
filter. The value of clutch
argument is used to
to plays that occured during clutch time.
A data.frame containing the aggregated player data retrieved with columns converted to the data types specified by statsnbaR's internal YAML.
integer - ID of the player, used in many other datasets
character - the player's first and last name
integer - the team_id
of the team the player plays for
according to the season selected (see filter_bio
)
character - abbreviated team name
integer - age of player in the season selected
numeric - games played within the selected filters
numeric - wins in the player's games within the selected filters
numeric - losses in the player's games within the selected filters
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.
filter_per_player
filter_per_player_clutch
http://stats.nba.com/help/glossary
1 2 3 4 5 6 | ## Not run:
# Get data to compare clutch vs regular performance.
ppd <- per_player_agg(filter_per_player(season=2014))
ppdc <- per_player_agg(filter_per_player_clutch(season=2014))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.