https://github.com/sportsdataverse/hoopr
An R package to quickly obtain clean and tidy men's basketball play by play data.
https://github.com/sportsdataverse/hoopr
basketball college-basketball espn kenpom nba nba-analytics nba-api nba-data nba-statistics nba-stats nba-stats-api ncaa ncaa-basketball ncaa-bracket ncaa-players ncaa-ratings ncaam r sportsdataverse
Last synced: 2 months ago
JSON representation
An R package to quickly obtain clean and tidy men's basketball play by play data.
- Host: GitHub
- URL: https://github.com/sportsdataverse/hoopr
- Owner: sportsdataverse
- License: other
- Created: 2020-08-20T05:29:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T23:23:27.000Z (about 1 year ago)
- Last Synced: 2025-03-30T01:11:10.536Z (3 months ago)
- Topics: basketball, college-basketball, espn, kenpom, nba, nba-analytics, nba-api, nba-data, nba-statistics, nba-stats, nba-stats-api, ncaa, ncaa-basketball, ncaa-bracket, ncaa-players, ncaa-ratings, ncaam, r, sportsdataverse
- Language: R
- Homepage: http://hoopr.sportsdataverse.org/
- Size: 39.5 MB
- Stars: 91
- Watchers: 13
- Forks: 20
- Open Issues: 39
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---#
# hoopR
![]()
```{r setup, include = FALSE}
require(knitr)
if (!requireNamespace('pacman')){
install.packages('pacman')
}
pacman::p_load(dplyr)opts_template$set(stripfigure = list(fig.height = 8, out.width = "95%"))
```
[](https://CRAN.R-project.org/package=hoopR)
[](https://CRAN.R-project.org/package=hoopR)
[](https://github.com/sportsdataverse/hoopR) [](https://github.com/sportsdataverse/hoopR/actions/workflows/R-CMD-check.yaml) [](https://github.com/sportsdataverse/hoopR/)[](https://github.com/sportsdataverse/hoopR/graphs/contributors)
[**`hoopR`**](https://hoopR.sportsdataverse.org/) 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. As of version 1.3.0, [**`hoopR`**](https://hoopR.sportsdataverse.org/) is also a full NBA Stats API wrapper with 127 functions added in this release.
It is additionally a scraping and aggregating interface for Ken Pomeroy's men's college basketball statistics website, [kenpom.com](https://kenpom.com/). It provides users with an active subscription the capability to scrape the website tables and analyze the data for themselves.
## Installation
You can install the CRAN version of [**```hoopR```** ](https://CRAN.R-project.org/package=hoopR) with:
```{r readme_cran_install, eval=FALSE}
install.packages("hoopR")
```You can install the released version of [**`hoopR`**](https://github.com/sportsdataverse/hoopR/) from [GitHub](https://github.com/sportsdataverse/hoopR) with:
```{r readme_pacman_install, eval=FALSE}
# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
install.packages('pacman')
}
pacman::p_load_current_gh("sportsdataverse/hoopR", dependencies = TRUE, update = TRUE)
```## Quick Start
### **NBA full play-by-play seasons (2002-`r hoopR::most_recent_nba_season()`) ~ 1-2 minutes**
```{r nba_load_pbp_readme}
tictoc::tic()
progressr::with_progress({
nba_pbp <- hoopR::load_nba_pbp()
})
tictoc::toc()
```
```{r nba_pbp_message, echo = FALSE}
glue::glue("{nrow(nba_pbp)} rows of NBA play-by-play data from {length(unique(nba_pbp$game_id))} games.")
```### **Men's college basketball full play-by-play seasons (2006-`r hoopR::most_recent_mbb_season()`) ~ 2-3 minutes**
```{r mbb_load_pbp_readme}tictoc::tic()
progressr::with_progress({
mbb_pbp <- hoopR::load_mbb_pbp()
})
tictoc::toc()
``````{r mbb_pbp_message, echo = FALSE}
glue::glue("{nrow(mbb_pbp)} rows of men's college basketball play-by-play data from {length(unique(mbb_pbp$game_id))} games.")
```## **Documentation**
For more information on the package and function reference, please see the [**`hoopR`** documentation website](https://hoopR.sportsdataverse.org).
## **Breaking Changes**
[**Full News on Releases**](https://hoopR.sportsdataverse.org/news/index.html)
## Follow the SportsDataverse (@SportsDataverse) on Twitter and star this repo
[](https://github.com/sportsdataverse/hoopR/stargazers/)
## **Our Authors**
- Saiem Gilani (@saiemgilani)
## **Our Contributors (they're awesome)**
- Jason Lee (@theFirmAISports)
- Billy Fryer (@_b4billy_)
- Ross Drucker (@rossdrucker9)
- Vladislav Shufinskiy (@vshufinskiy)
## **Citations**
To cite the [**`hoopR`**](https://hoopR.sportsdataverse.org) R package in publications, use:
BibTex Citation
```bibtex
@misc{gilani_2021_hoopR,
author = {Gilani, Saiem},
title = {hoopR: The SportsDataverse's R Package for Men's Basketball Data.},
url = {https://hoopR.sportsdataverse.org},
year = {2021}
}
```