Skip to contents

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

.for_cran()
# \donttest{
try({ # prevents cran errors
  load_nextgen_stats(stat_type = "passing")
  load_nextgen_stats(stat_type = "receiving")
  load_nextgen_stats(stat_type = "rushing")
})
#> ── nflverse Next Gen Stats weekly rushing data ─────────────────────────────────
#>  Data updated: 2024-02-29 07:18:03 UTC
#> # A tibble: 4,810 × 22
#>    season season_type  week player_display_name player_position team_abbr
#>     <int> <chr>       <int> <chr>               <chr>           <chr>    
#>  1   2016 REG             0 Latavius Murray     RB              LV       
#>  2   2016 REG             0 Tim Hightower       RB              NO       
#>  3   2016 REG             0 Matt Asiata         RB              MIN      
#>  4   2016 REG             0 David Johnson       RB              ARI      
#>  5   2016 REG             0 Jonathan Stewart    RB              CAR      
#>  6   2016 REG             0 Jay Ajayi           RB              MIA      
#>  7   2016 REG             0 LeSean McCoy        RB              BUF      
#>  8   2016 REG             0 Paul Perkins        RB              NYG      
#>  9   2016 REG             0 C.J. Anderson       RB              DEN      
#> 10   2016 REG             0 LeGarrette Blount   RB              NE       
#> # ℹ 4,800 more rows
#> # ℹ 16 more variables: efficiency <dbl>,
#> #   percent_attempts_gte_eight_defenders <dbl>, avg_time_to_los <dbl>,
#> #   rush_attempts <int>, rush_yards <int>, expected_rush_yards <dbl>,
#> #   rush_yards_over_expected <dbl>, avg_rush_yards <dbl>,
#> #   rush_yards_over_expected_per_att <dbl>, rush_pct_over_expected <dbl>,
#> #   rush_touchdowns <int>, player_gsis_id <chr>, player_first_name <chr>, …
# }