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.

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

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 "rds" or "qs". 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

Examples

# \donttest{ load_nextgen_stats(stat_type = "passing")
#> # A tibble: 3,131 × 29 #> season season_type week player_display_name player_position team_abbr #> <int> <chr> <int> <chr> <chr> <chr> #> 1 2016 REG 0 Matt Ryan QB ATL #> 2 2016 REG 0 Eli Manning QB NYG #> 3 2016 REG 0 Aaron Rodgers QB GB #> 4 2016 REG 0 Marcus Mariota QB TEN #> 5 2016 REG 0 Russell Wilson QB SEA #> 6 2016 REG 0 Joe Flacco QB BAL #> 7 2016 REG 0 Drew Brees QB NO #> 8 2016 REG 0 Brian Hoyer QB CHI #> 9 2016 REG 0 Josh McCown QB CLE #> 10 2016 REG 0 Robert Griffin III QB CLE #> # … with 3,121 more rows, and 23 more variables: avg_time_to_throw <dbl>, #> # avg_completed_air_yards <dbl>, avg_intended_air_yards <dbl>, #> # avg_air_yards_differential <dbl>, aggressiveness <dbl>, #> # max_completed_air_distance <dbl>, avg_air_yards_to_sticks <dbl>, #> # attempts <int>, pass_yards <int>, pass_touchdowns <int>, #> # interceptions <int>, passer_rating <dbl>, completions <int>, #> # completion_percentage <dbl>, expected_completion_percentage <dbl>, …
load_nextgen_stats(stat_type = "receiving")
#> # A tibble: 8,051 × 23 #> season season_type week player_display_name player_position team_abbr #> <int> <chr> <int> <chr> <chr> <chr> #> 1 2016 REG 0 Tyreek Hill WR KC #> 2 2016 REG 0 Richard Rodgers TE GB #> 3 2016 REG 0 Travis Benjamin WR LAC #> 4 2016 REG 0 Cordarrelle Patterson WR MIN #> 5 2016 REG 0 DeSean Jackson WR WAS #> 6 2016 REG 0 Albert Wilson WR KC #> 7 2016 REG 0 Brandin Cooks WR NO #> 8 2016 REG 0 Rishard Matthews WR TEN #> 9 2016 REG 0 Taylor Gabriel WR ATL #> 10 2016 REG 0 Phillip Dorsett WR IND #> # … with 8,041 more rows, and 17 more variables: avg_cushion <dbl>, #> # avg_separation <dbl>, avg_intended_air_yards <dbl>, #> # percent_share_of_intended_air_yards <dbl>, receptions <int>, targets <int>, #> # catch_percentage <dbl>, yards <int>, rec_touchdowns <int>, avg_yac <dbl>, #> # avg_expected_yac <dbl>, avg_yac_above_expectation <dbl>, #> # player_gsis_id <chr>, player_first_name <chr>, player_last_name <chr>, #> # player_jersey_number <int>, player_short_name <chr>
load_nextgen_stats(stat_type = "rushing")
#> # A tibble: 3,215 × 22 #> season season_type week player_display_name player_position team_abbr #> <int> <chr> <int> <chr> <chr> <chr> #> 1 2016 REG 0 David Johnson RB ARI #> 2 2016 REG 0 Latavius Murray RB LV #> 3 2016 REG 0 Paul Perkins RB NYG #> 4 2016 REG 0 Jonathan Stewart RB CAR #> 5 2016 REG 0 LeSean McCoy RB BUF #> 6 2016 REG 0 Tim Hightower RB NO #> 7 2016 REG 0 C.J. Anderson RB DEN #> 8 2016 REG 0 Matt Asiata RB MIN #> 9 2016 REG 0 Doug Martin RB TB #> 10 2016 REG 0 Jay Ajayi RB MIA #> # … with 3,205 more rows, and 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>, #> # player_last_name <chr>, player_jersey_number <int>, …
# }