The bbr package is designed to quickly fetch tidy data from www.basketball-reference.com. This package is actively under development and the interface will change as new features are added.
devtools::install_github("mbjoseph/bbr")
The get_season
function retrieves season summary data for one season.
library(bbr) ninetyone <- get_season(1991) str(ninetyone)
The get_players
function gets player data for individuals by last initial.
a_data <- get_players("A") str(a_data)
The get_player_data
function returns data for each season that a player
played. As an argument, this function takes a slug for the player you're
interested in. This can be found using the get_players()
function, and is
part of the URL to the data of a player, e.g., if the URL is
https://www.basketball-reference.com/players/a/abdelal01.html then the slug is
abdelal01.
abdelnaby_d <- get_player_data('abdelal01') str(abdelnaby_d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.