-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathREADME.Rmd
122 lines (86 loc) · 6.5 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
output: github_document
---
#
# hoopR <a href='https://hoopR.sportsdataverse.org/'><img src="https://raw.githubusercontent.com/sportsdataverse/hoopR/main/logo.png" align="right" width="20%" min-width="100px"/></a>
```{r setup, include = FALSE}
require(knitr)
if (!requireNamespace('pacman')){
install.packages('pacman')
}
pacman::p_load(magick, grid, dplyr, lubridate)
opts_template$set(stripfigure = list(fig.height = 8, out.width = "95%"))
```
<!-- badges: start -->
[](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://twitter.com/saiemgilani) [](https://twitter.com/SportsDataverse) [](/~https://github.com/sportsdataverse/hoopR/graphs/contributors)
<!-- badges: end -->
[**`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-2022) ~ 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-2022) ~ 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](https://twitter.com/SportsDataverse) on Twitter and star this repo
[](https://twitter.com/SportsDataverse)
[](/~https://github.com/sportsdataverse/hoopR/stargazers/)
## **Our Authors**
- [Saiem Gilani](https://twitter.com/saiemgilani)
<a href="https://twitter.com/saiemgilani" target="blank"><img src="https://img.shields.io/twitter/follow/saiemgilani?color=blue&label=%40saiemgilani&logo=twitter&style=for-the-badge" alt="@saiemgilani" /></a>
<a href="/~https://github.com/saiemgilani" target="blank"><img src="https://img.shields.io/github/followers/saiemgilani?color=eee&logo=Github&style=for-the-badge" alt="@saiemgilani" /></a>
## **Our Contributors (they're awesome)**
- [Jason Lee](https://twitter.com/theFirmAISports)
<a href="https://twitter.com/theFirmAISports" target="blank"><img src="https://img.shields.io/twitter/follow/theFirmAISports?color=blue&label=%40theFirmAISports&logo=twitter&style=for-the-badge" alt="@theFirmAISports" /></a>
<a href="/~https://github.com/papagorgio23" target="blank"><img src="https://img.shields.io/github/followers/papagorgio23?color=eee&logo=Github&style=for-the-badge" alt="@papagorgio23" /></a>
- [Billy Fryer](https://twitter.com/_b4billy_)
<a href="https://twitter.com/_b4billy_" target="blank"><img src="https://img.shields.io/twitter/follow/_b4billy_?color=blue&label=%40_b4billy_&logo=twitter&style=for-the-badge" alt="@_b4billy_" /></a>
<a href="/~https://github.com/billyfryer" target="blank"><img src="https://img.shields.io/github/followers/billyfryer?color=eee&logo=Github&style=for-the-badge" alt="@billyfryer" /></a>
## **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}
}
```