-
Notifications
You must be signed in to change notification settings - Fork 12
/
README.Rmd
122 lines (85 loc) · 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
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(tibble)
options(tibble.max_extra_cols = 10,
tibble.bold = TRUE,
tibble.print_max = 5,
pillar.min_title_width = 5)
```
# nflreadr <a href='https://nflreadr.nflverse.com'><img src='man/figures/logo.svg' align="right" width="25%" min-width="120px" /></a>
<!-- badges: start -->
[![CRAN status](https://img.shields.io/cran/v/nflreadr?style=flat-square&logo=R&label=CRAN)](https://CRAN.R-project.org/package=nflreadr)
[![Codecov test coverage](https://img.shields.io/codecov/c/github/nflverse/nflreadr?label=codecov&style=flat-square&logo=codecov)](https://app.codecov.io/gh/nflverse/nflreadr?branch=main)
[![Dev status](https://img.shields.io/github/r-package/v/nflverse/nflreadr/main?label=dev%20version&style=flat-square&logo=github)](https://nflreadr.nflverse.com/)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html)
[![R build status](https://img.shields.io/github/actions/workflow/status/nflverse/nflreadr/R-CMD-check.yaml?label=R%20check&style=flat-square&logo=github)](https://github.com/nflverse/nflreadr/actions)
[![nflverse discord](https://img.shields.io/discord/789805604076126219?color=7289da&label=nflverse%20discord&logo=discord&logoColor=fff&style=flat-square)](https://discord.com/invite/5Er2FBnnQa)
<!-- badges: end -->
nflreadr is a minimal package for downloading data from nflverse repositories. It includes caching, optional progress updates, and data dictionaries.
Please note that nflverse data repositories have been reorganized and pushed towards the [nflverse-data](https://github.com/nflverse/nflverse-data) repo, and v1.2.0+ is the minimum version that supports this change. We encourage all users to upgrade to this version immediately.
For Python access to nflverse data, please check out [nfl-data-py](https://pypi.org/project/nfl-data-py/) - maintained by Cooper Adams.
## Installation
Install the stable version from CRAN with:
```{r eval = FALSE}
install.packages("nflreadr")
```
Install the development version from GitHub with:
```{r eval = FALSE}
install.packages("nflreadr", repos = c("https://nflverse.r-universe.dev", getOption("repos")))
# or use remotes/devtools
# install.packages("remotes")
remotes::install_github("nflverse/nflreadr")
```
## Usage
The main functions of `nflreadr` are prefixed with `load_`.
```{r}
library(nflreadr)
load_pbp(2021)
load_player_stats(2021)
```
## Data Sources
Data accessed by this package is stored on GitHub and can typically be found in one of the following repositories:
- [nflverse/nflverse-data](https://github.com/nflverse/nflverse-data)
- [nflverse/nfldata](https://github.com/nflverse/nfldata)
- [nflverse/espnscrapeR-data](https://github.com/nflverse/espnscrapeR-data)
- [dynastyprocess/data](https://github.com/dynastyprocess/data)
- [ffverse/ffopportunity](https://github.com/ffverse/ffopportunity)
For a full list of functions, please see the [reference page](https://nflreadr.nflverse.com/reference/index.html).
This data is maintained by the nflverse project team and is primarily automated via GitHub Actions. You can check the status and schedules page here: <https://github.com/nflverse/nflverse-data>
## Configuration
The following options help configure default `nflreadr` behaviours.
```{r eval = FALSE}
options(nflreadr.verbose)
# TRUE/FALSE to silence messages such as cache warnings
options(nflreadr.cache)
# one of "memory", "filesystem", or "off"
options(nflreadr.prefer)
# one of "qs", "rds", "parquet", or "csv"
options(nflreadr.download_path)
# defaults to current working directory - change to specify where `nflverse_download()` places data.
```
You can also configure `nflreadr` to display progress messages with the [`progressr` package](https://progressr.futureverse.org), e.g.
```{r eval = FALSE}
progressr::with_progress(load_rosters(seasons = 2010:2020))
|======== | 40%
```
## Getting help
The best places to get help on this package are:
- the [nflverse discord](https://discord.com/invite/5Er2FBnnQa) (for both this package as well as anything R/NFL related)
- opening [an issue](https://github.com/nflverse/nflreadr/issues/new/choose)
## Contributing
Many hands make light work! Here are some ways you can contribute to
this project:
- You can [open an issue](https://github.com/nflverse/nflreadr/issues/new/choose) if you’d like to request specific data or report a bug/error.
- If you’d like to contribute code, please check out [the contribution guidelines](https://nflreadr.nflverse.com/CONTRIBUTING.html).
## Terms of Use
The R code for this package is released as open source under the [MIT License](https://nflreadr.nflverse.com/LICENSE.html). NFL data accessed by this package belong to their respective owners, and are governed by their terms of use.