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

.for_cran()
# \donttest{
  try({ # prevents CRAN errors
  load_snap_counts()
  })
#> ── nflverse snap counts ────────────────────────────────────────────────────────
#>  Data updated: 2024-02-12 18:22:38 UTC
#> # A tibble: 26,513 × 16
#>    game_id      pfr_game_id season game_type  week player pfr_player_id position
#>    <chr>        <chr>        <int> <chr>     <int> <chr>  <chr>         <chr>   
#>  1 2023_01_ARI… 202309100w…   2023 REG           1 Saahd… CharSa00      T       
#>  2 2023_01_ARI… 202309100w…   2023 REG           1 Andre… WyliAn00      G       
#>  3 2023_01_ARI… 202309100w…   2023 REG           1 Charl… LenoCh00      T       
#>  4 2023_01_ARI… 202309100w…   2023 REG           1 Sam H… HoweSa00      QB      
#>  5 2023_01_ARI… 202309100w…   2023 REG           1 Nick … GateNi00      C       
#>  6 2023_01_ARI… 202309100w…   2023 REG           1 Samue… CosmSa00      T       
#>  7 2023_01_ARI… 202309100w…   2023 REG           1 Terry… McLaTe00      WR      
#>  8 2023_01_ARI… 202309100w…   2023 REG           1 Jahan… DotsJa00      WR      
#>  9 2023_01_ARI… 202309100w…   2023 REG           1 Logan… ThomLo00      TE      
#> 10 2023_01_ARI… 202309100w…   2023 REG           1 Curti… SamuCu00      WR      
#> # ℹ 26,503 more rows
#> # ℹ 8 more variables: team <chr>, opponent <chr>, offense_snaps <dbl>,
#> #   offense_pct <dbl>, defense_snaps <dbl>, defense_pct <dbl>, st_snaps <dbl>,
#> #   st_pct <dbl>
# }