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
# \donttest{
try({ # prevents cran errors
load_pfr_advstats()
})
#> ── nflverse advanced pass weekly stats via PFR ─────────────────────────────────
#> ℹ Data updated: 2023-01-05 07:14:48 UTC
#> # A tibble: 36 × 24
#> game_id pfr_g…¹ season week game_…² team oppon…³ pfr_p…⁴ pfr_p…⁵ passi…⁶
#> <chr> <chr> <int> <int> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 2022_17_A… 202301… 2022 17 REG ATL ARI Desmon… RiddDe… 0
#> 2 2022_17_A… 202301… 2022 17 REG ARI ATL David … BlouDa… 1
#> 3 2022_17_C… 202301… 2022 17 REG DET CHI Jared … GoffJa… 1
#> 4 2022_17_C… 202301… 2022 17 REG CHI DET Justin… FielJu… 0
#> 5 2022_17_J… 202301… 2022 17 REG HOU JAX Davis … MillDa… 1
#> 6 2022_17_J… 202301… 2022 17 REG HOU JAX Jeff D… DrisJe… 1
#> 7 2022_17_J… 202301… 2022 17 REG JAX HOU Trevor… LawrTr… 0
#> 8 2022_17_J… 202301… 2022 17 REG JAX HOU C.J. B… BeatC.… 1
#> 9 2022_17_D… 202301… 2022 17 REG KC DEN Patric… MahoPa… 1
#> 10 2022_17_D… 202301… 2022 17 REG DEN KC Russel… WilsRu… 2
#> # … with 26 more rows, 14 more variables: 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>, and abbreviated variable
#> # names ¹pfr_game_id, ²game_type, ³opponent, ⁴pfr_player_name, …
# }