gamezoneR
is an R package for working with NCAA Men’s Basketball play-by-play data from STATS LLC’s GameZone. The package allows users to scrape team and master schedules as well as play-by-play data with shot locations into a tidy format. The main benefit of gamezoneR
is the volume of shot location data available. While ESPN also charts shots, as of March 10th 2021, ESPN has charted approximately 70,000 shots while STATS LLC has charted over 170,000 from the 2020-21 college basketball season alone!
You can install gamezoneR
from GitHub with:
# Install via devtools package using the following:
devtools::install_github(repo = "JackLich10/gamezoneR")
For a quick introduction to the package, visit the Intro to gamezoneR
article.
If you want to load in all available play-by-play data dating back to the 2017-18 season, use the following code:
future::plan("multisession")
tictoc::tic()
progressr::with_progress({
pbp <- gamezoneR::load_gamezone_pbp(gamezoneR:::available_seasons())
})
tictoc::toc()
## 48.078 sec elapsed
length(unique(pbp$game_id))
## 24,994 games
pbp %>% dplyr::filter(!is.na(loc_x)) %>% nrow()
## 2,843,392 shot locations
For more information on the package and function reference, please see the gamezoneR
documentation.
Please note that the gamezoneR
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.