hoopR
is an R package for
working with men’s basketball data.
The package has functions to access live play by play and box score data from ESPN with shot locations when available.
It is additionally a scraping and aggregating interface for Ken Pomeroy’s men’s college basketball statistics website, kenpom.com. It provides users with an active subscription the capability to scrape the website tables and analyze the data for themselves.
You can install the released version of
hoopR
from
GitHub with:
# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
install.packages('pacman')
}
pacman::p_load_current_gh("saiemgilani/hoopR")
# if you would prefer devtools installation
if (!requireNamespace('devtools', quietly = TRUE)){
install.packages('devtools')
}
# Alternatively, using the devtools package:
devtools::install_github(repo = "saiemgilani/hoopR")
# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
install.packages('pacman')
}
pacman::p_load_current_gh("saiemgilani/hoopR")
future::plan("multisession")
tictoc::tic()
progressr::with_progress({
pbp <- load_nba_pbp(2002:2021)
})
tictoc::toc()
## 66.99 sec elapsed
length(unique(pbp$game_id))
nrow(pbp)
# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
install.packages('pacman')
}
pacman::p_load_current_gh("saiemgilani/hoopR")
future::plan("multisession")
tictoc::tic()
progressr::with_progress({
pbp <- load_mbb_pbp(2002:2021)
})
tictoc::toc()
## 135.87 sec elapsed
length(unique(pbp$game_id))
nrow(pbp)
For more information on the package and function reference, please see
the hoopR
documentation
website.
- Adding
httr::retry()
to all function calls to more naturally navigate rejected/failed requests from the API.
This update is a non-user facing change to package dependencies to shrink the list of dependencies.
To reflect that the package is no longer just a men’s college basketball and KenPom package, but also an NBA package.
- All functions have now been given the
janitor::clean_names()
treatment hoopR::espn_mbb_teams()
has updated the returns to be more identity information related onlyhoopR::espn_nba_teams()
to be more identity information related only- All tests were updated
hoopR::load_mbb_pbp()
andhoopR::update_mbb_db()
functions addedhoopR::load_nba_pbp()
andhoopR::update_nba_db()
functions added
View more version news
- Added support for ESPN’s NBA play-by-play endpoints with the addition of the following functions:
hoopR::espn_nba_game_all()
- a convenience wrapper function around the following three functions (returns the results as a list of three data frames)hoopR::espn_nba_team_box()
hoopR::espn_nba_player_box()
hoopR::espn_nba_pbp()
hoopR::espn_nba_teams()
hoopR::espn_nba_scoreboard()
R
version 3.5.0 or greater dependency addedpurrr
version 0.3.0 or greater dependency addedrvest
version 1.0.0 or greater dependency addedprogressr
version 0.6.0 or greater dependency addedusethis
version 1.6.0 or greater dependency addedxgboost
version 1.1.0 or greater dependency addedtidyr
version 1.0.0 or greater dependency addedstringr
version 1.3.0 or greater dependency addedtibble
version 3.0.0 or greater dependency addedfurrr
dependency addedfuture
dependency added
- Added tests for all KP and ESPN functions
-
All functions sourced from kenpom.com will start with
kp_
as opposed toget_
-
Similarly, data and metrics sourced from ESPN will begin with
espn_
as opposed tocbb_
. Moreover, all references tocbb_
have been changed tombb_
as appropriate. -
Data sourced directly from the NCAA website will start the function with
ncaa_
See the following four eight functions:
-
hoopR::espn_mbb_teams()
(bumps to v0.2.1) -
hoopR::espn_mbb_conferences()
(bumps to v0.2.1) -
hoopR::espn_mbb_scoreboard()
(bumps to v0.2.2) -
hoopR::ncaa_mbb_NET_rankings()
(bumps to v0.2.3) -
hoopR::espn_mbb_rankings()
(bumps to v0.2.3)
issue | icon | title | labels | opened_by | date | closed |
---|---|---|---|---|---|---|
NA | NA | NA | NA | NA | NA | NA |
View More
issue | icon | title | labels | opened_by | date | closed |
---|---|---|---|---|---|---|
14 | ![]() |
Error in “update_nba_db”: could not find function “my_time” | jedwards757 | 2021-05-20 | 2021-05-20 22:53:32 | |
1 | ![]() |
gameplan function error | bug | mcoleman9221 | 2021-01-28 | 2021-01-28 03:31:48 |
16 | ![]() |
add retry | saiemgilani | 2021-05-21 | 2021-05-21 09:09:54 | |
15 | ![]() |
my_time | bug | saiemgilani | 2021-05-20 | 2021-05-20 19:32:20 |
13 | ![]() |
dependency pruning the functions | saiemgilani | 2021-05-20 | 2021-05-20 13:52:01 |