You can install basketballstatsR
from github as follows:
install.packages("devtools")
devtools::install_github("emilykuehler/basketballstatsR")
This package is in development, but current functionality supports a variety of data gathering operations for NBA data. Currently, I am scraping from basketball-reference.com
however, sites such as NBA.com also have interesting data so will expand there soon.
basic_stats_lst <- basic_per_game_stats(c('stephen curry', 'Draymond green'))
Function will return a list of dataframes. Each dataframe contains basic per game stats for the given players for each of their seasons.
Function will return a list of dataframes. Each dataframe contains basic counting stats for the given players for each of their seasons.
advanced_stats_lst <- player_advanced_stats(c('michael jordan', 'magic johnson'))
Function will return a list of dataframes. Each dataframe contains advanced stats (per year) for the given players for each of their seasons.
stats_per_100_poss_lst <- player_per_100poss(c('kevin durant', 'Russell Westbrook'))
Function will return a list of dataframes where each dataframe contains basic stats normalized per 100 possessions for the given players for each of their seasons.
stats_per_36mins_lst <- player_per_36mins(c('kevin durant', 'Russell Westbrook'))
Function will return a list of dataframes where each dataframe contains basic stats normalized per 36 minutes for the given players.
players <- c('stephen curry', 'stephen curry', 'tim hardaway')
years <- c(2015, 2016, 1992)
game_logs <- player_game_logs(players, years)
Function returns a list of dataframes where each dataframe contains gamelogs for the requested players and years.
triple_doubles_lst <- get_triple_doubles('russell westbrook', c(2010,2015,2016))
Function returns a list of datrames where each dataframe contains the gamelogs in which the player scored a triple double.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.