Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nflverse/nflreadr

Efficiently download nflverse data
https://github.com/nflverse/nflreadr

cran nfl nflfastr nflverse r r-package sports-data

Last synced: 8 days ago
JSON representation

Efficiently download nflverse data

Awesome Lists containing this project

README

        

---
output: github_document
---

```{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

[![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)

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:

## 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.