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 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 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 - maintained by Cooper Adams.
Install the stable version from CRAN with:
install.packages("nflreadr")
Install the development version from GitHub with:
install.packages("nflreadr", repos = c("https://nflverse.r-universe.dev", getOption("repos"))) # or use remotes/devtools # install.packages("remotes") remotes::install_github("nflverse/nflreadr")
The main functions of nflreadr
are prefixed with load_
.
library(nflreadr) load_pbp(2021) load_player_stats(2021)
Data accessed by this package is stored on GitHub and can typically be found in one of the following repositories:
For a full list of functions, please see the reference page.
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
The following options help configure default nflreadr
behaviours.
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, e.g.
progressr::with_progress(load_rosters(seasons = 2010:2020)) |======== | 40%
The best places to get help on this package are:
Many hands make light work! Here are some ways you can contribute to this project:
You can open an issue 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.
The R code for this package is released as open source under the MIT License. NFL data accessed by this package belong to their respective owners, and are governed by their terms of use.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.