-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
52 lines (38 loc) · 1.78 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
---
output: github_document
---
# bbr: basketball-reference data in R
[](https://travis-ci.org/mbjoseph/bbr)
[](https://codecov.io/github/mbjoseph/bbr?branch=master)
[](https://cran.r-project.org/package=bbr)
[](https://www.gnu.org/licenses/old-licenses/gpl-3.0.html)
[)`-brightgreen.svg)](/commits/master)
<!-- README.md is generated from README.Rmd. Please edit that file -->
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.
## Installation
```{r, eval = FALSE}
devtools::install_github("mbjoseph/bbr")
```
## Example usage
The `get_season` function retrieves season summary data for one season.
```{r, echo = TRUE}
library(bbr)
ninetyone <- get_season(1991)
str(ninetyone)
```
The `get_players` function gets player data for individuals by last initial.
```{r, echo = TRUE}
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.
```{r, echo = TRUE}
abdelnaby_d <- get_player_data('abdelal01')
str(abdelnaby_d)
```