Loads player level season stats provided by Pro Football Reference starting with the 2018 season, primarily to augment existing nflverse data.
Usage
load_pfr_advstats(
seasons = most_recent_season(),
stat_type = c("pass", "rush", "rec", "def"),
summary_level = c("week", "season"),
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 "pass", "rush", "rec", "def"
- summary_level
one of "week" (default) or "season" - some data is only available at the season level
- file_type
One of
c("rds", "qs", "csv", "parquet")
. Can also be set globally withoptions(nflreadr.prefer)
Value
A tibble of player statistics provided by Pro Football Reference that supplements data in nflverse
See also
https://nflreadr.nflverse.com/articles/dictionary_pfr_passing.html for the web data dictionary
https://www.pro-football-reference.com/years/2021/passing_advanced.htm
Issues with this data should be filed here: https://github.com/nflverse/nflverse-data
Examples
.for_cran()
# \donttest{
try({ # prevents cran errors
load_pfr_advstats()
})
#> ── nflverse advanced pass weekly stats via PFR ─────────────────────────────────
#> ℹ Data updated: 2023-10-09 07:15:21 UTC
#> # A tibble: 153 × 24
#> game_id pfr_game_id season week game_type team opponent pfr_player_name
#> <chr> <chr> <int> <int> <chr> <chr> <chr> <chr>
#> 1 2023_01_DE… 202309070k… 2023 1 REG KC DET Patrick Mahomes
#> 2 2023_01_DE… 202309070k… 2023 1 REG DET KC Jared Goff
#> 3 2023_01_CA… 202309100a… 2023 1 REG ATL CAR Desmond Ridder
#> 4 2023_01_CA… 202309100a… 2023 1 REG CAR ATL Bryce Young
#> 5 2023_01_HO… 202309100r… 2023 1 REG BAL HOU Lamar Jackson
#> 6 2023_01_HO… 202309100r… 2023 1 REG HOU BAL C.J. Stroud
#> 7 2023_01_CI… 202309100c… 2023 1 REG CLE CIN Deshaun Watson
#> 8 2023_01_CI… 202309100c… 2023 1 REG CIN CLE Joe Burrow
#> 9 2023_01_CI… 202309100c… 2023 1 REG CIN CLE Jake Browning
#> 10 2023_01_JA… 202309100c… 2023 1 REG IND JAX Anthony Richar…
#> # ℹ 143 more rows
#> # ℹ 16 more variables: pfr_player_id <chr>, passing_drops <dbl>,
#> # passing_drop_pct <dbl>, receiving_drop <dbl>, receiving_drop_pct <dbl>,
#> # passing_bad_throws <dbl>, passing_bad_throw_pct <dbl>, times_sacked <dbl>,
#> # times_blitzed <dbl>, times_hurried <dbl>, times_hit <dbl>,
#> # times_pressured <dbl>, times_pressured_pct <dbl>, def_times_blitzed <dbl>,
#> # def_times_hurried <dbl>, def_times_hitqb <dbl>
# }