getGenericData: Retrieve a generic data source

Description Usage Arguments Value Examples

Description

This function retrieves the specified data source. Use searchEndpoints to see valid options for the endpoint parameter (these are the available datasets) and getEndpointParams to learn what parameters are needed to pass in as the params argument for the chosen endpoint.

Usage

1
getGenericData(endpoint, params = list())

Arguments

endpoint,

endpoint to retrieve as a character vector

params,

list of parameters

Value

A data frame or a list of data frames (if the endpoint returns multiple datasets) containing the requested data.

Examples

1
2
3
4
5
6
7
8
9
player.info.endpoint <- "commonplayerinfo"
player.info.params <-list(PlayerID=201939,IsOnlyCurrentSeason=0,LeagueID="00",Season="2015-16")
player.info <- getGenericData(player.info.endpoint, player.info.params)
str(player.info)
######
game.log.endpoint <- "playergamelog"
game.log.params <- list(PlayerID = 201939, Season = "2015-16", SeasonType = "Regular+Season")
game.log <- getGenericData(game.log.endpoint, game.log.params)
str(game.log)

llefebure/nba-stats documentation built on May 21, 2019, 7:34 a.m.