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 withoptions(nflreadr.prefer)
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: 2023-01-02 12:34:55 UTC
#> # A tibble: 23,651 × 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 23,641 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
# }