Skip to contents

Loads game level snap counts stats provided by Pro Football Reference starting with the 2012 season.

Usage

load_snap_counts(
  seasons = most_recent_season(),
  file_type = getOption("nflreadr.prefer", default = "rds")
)

Arguments

seasons

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

file_type

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

Value

A tibble of game-level snap counts provided by Pro Football Reference.

See also

https://nflreadr.nflverse.com/articles/dictionary_snap_counts.html for the web data dictionary

dictionary_snap_counts for the data dictionary as bundled within the package

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

Examples

# \donttest{
  try({ # prevents CRAN errors
  load_snap_counts()
  })
#> ── nflverse snap counts ────────────────────────────────────────────────────────
#>  Data updated: 2022-09-27 12:52:49 UTC
#> # A tibble: 4,436 × 16
#>    game_id     pfr_g…¹ season game_…²  week player pfr_p…³ posit…⁴ team  oppon…⁵
#>    <chr>       <chr>    <int> <chr>   <int> <chr>  <chr>   <chr>   <chr> <chr>  
#>  1 2022_01_BA… 202209…   2022 REG         1 Max M… MitcMa… T       NYJ   BAL    
#>  2 2022_01_BA… 202209…   2022 REG         1 Laken… TomlLa… G       NYJ   BAL    
#>  3 2022_01_BA… 202209…   2022 REG         1 Alija… VeraAl… G       NYJ   BAL    
#>  4 2022_01_BA… 202209…   2022 REG         1 Georg… FantGe… T       NYJ   BAL    
#>  5 2022_01_BA… 202209…   2022 REG         1 Conno… McGoCo… C       NYJ   BAL    
#>  6 2022_01_BA… 202209…   2022 REG         1 Joe F… FlacJo… QB      NYJ   BAL    
#>  7 2022_01_BA… 202209…   2022 REG         1 Tyler… ConkTy… TE      NYJ   BAL    
#>  8 2022_01_BA… 202209…   2022 REG         1 Elija… MoorEl… WR      NYJ   BAL    
#>  9 2022_01_BA… 202209…   2022 REG         1 Corey… DaviCo… WR      NYJ   BAL    
#> 10 2022_01_BA… 202209…   2022 REG         1 Micha… CartMi… RB      NYJ   BAL    
#> # … with 4,426 more rows, 6 more variables: offense_snaps <dbl>,
#> #   offense_pct <dbl>, defense_snaps <dbl>, defense_pct <dbl>, st_snaps <dbl>,
#> #   st_pct <dbl>, and abbreviated variable names ¹​pfr_game_id, ²​game_type,
#> #   ³​pfr_player_id, ⁴​position, ⁵​opponent
# }