load_nextgen_stats: Load Player Level Weekly NFL Next Gen Stats

View source: R/load_nextgen_stats.R

load_nextgen_statsR Documentation

Load Player Level Weekly NFL Next Gen Stats

Description

Loads player level weekly stats provided by NFL Next Gen Stats starting with the 2016 season. Three different stat types are available and the current season's data updates every night. NGS will only provide data for players above a minimum number of pass/rush/rec attempts.

Usage

load_nextgen_stats(
  seasons = TRUE,
  stat_type = c("passing", "receiving", "rushing"),
  file_type = getOption("nflreadr.prefer", default = "rds")
)

Arguments

seasons

a numeric vector specifying what seasons to return, if TRUE returns all available data

stat_type

one of "passing", "receiving", or "rushing"

file_type

One of c("rds", "qs", "csv", "parquet"). Can also be set globally with options(nflreadr.prefer)

Value

A tibble of week-level player statistics provided by NFL Next Gen Stats. Regular season summary is given for week == 0.

See Also

https://nextgenstats.nfl.com/stats/passing for stat_type = "passing"

https://nextgenstats.nfl.com/stats/receiving for stat_type = "receiving"

https://nextgenstats.nfl.com/stats/rushing for stat_type = "rushing"

https://nflreadr.nflverse.com/articles/dictionary_nextgen_stats.html for a web version of the data dictionary

dictionary_nextgen_stats for the data dictionary as bundled within the package

Issues with this data should be filed here: https://github.com/nflverse/nflverse-data

Examples



try({ # prevents cran errors
  load_nextgen_stats(stat_type = "passing")
  load_nextgen_stats(stat_type = "receiving")
  load_nextgen_stats(stat_type = "rushing")
})



nflreadr documentation built on Sept. 11, 2024, 6:14 p.m.