Description Usage Arguments Details
Grab the complete players data table from stats.nba.com and returns as it a data frame
1 2 | nbaStatsGrabber(url = "http://stats.nba.com/stats/commonallplayers?IsOnlyCurrentSeason=0&LeagueID=00&Season=2016-17",
index = 1)
|
url |
url from stats.nba.com which returns a standard formatted JSON object (cf. details for more info about the expected JSON structure) |
dim |
if the JSON object returns more than one data tables this argument can be used to specify which data shall be returned |
The typical JSON return objext from stats.nba.com is a list of three objects: 1. resource: Charater identifier (could be coupled to a base url string) 2. parameters: List; The parameters submitted in the JSON query to generate the data (in combinationo with the base URL stirng should reproduce update the data table) 3. resultsSet: The actual results, data lies in rowSet (df or vector there might be more than one rowset), column headers in headers, the id of the row set can be found under names The function extracts the rowSet and renames the columns of the rowSet to the corresponding headers (all other information in the JSON object are currently ommitted, although this might change in the future). By default always the first row set is extracted, behaviour can be changed by the index argument.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.