Skip to contents

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 with options(nflreadr.prefer)

Value

A tibble of player statistics provided by Pro Football Reference that supplements data in nflverse

Examples

# \donttest{
try({ # prevents cran errors
  load_pfr_advstats()
})
#> ── nflverse advanced pass weekly stats via PFR ─────────────────────────────────
#>  Data updated: 2024-10-03 07:17:55 UTC
#> # A tibble: 151 × 24
#>    game_id     pfr_game_id season  week game_type team  opponent pfr_player_name
#>    <chr>       <chr>        <int> <int> <chr>     <chr> <chr>    <chr>          
#>  1 2024_01_BA… 202409050k…   2024     1 REG       KC    BAL      Patrick Mahomes
#>  2 2024_01_BA… 202409050k…   2024     1 REG       BAL   KC       Lamar Jackson  
#>  3 2024_01_GB… 202409060p…   2024     1 REG       PHI   GB       Jalen Hurts    
#>  4 2024_01_GB… 202409060p…   2024     1 REG       GB    PHI      Jordan Love    
#>  5 2024_01_GB… 202409060p…   2024     1 REG       GB    PHI      Malik Willis   
#>  6 2024_01_PI… 202409080a…   2024     1 REG       ATL   PIT      Kirk Cousins   
#>  7 2024_01_PI… 202409080a…   2024     1 REG       PIT   ATL      Justin Fields  
#>  8 2024_01_AR… 202409080b…   2024     1 REG       BUF   ARI      Josh Allen     
#>  9 2024_01_AR… 202409080b…   2024     1 REG       ARI   BUF      Kyler Murray   
#> 10 2024_01_TE… 202409080c…   2024     1 REG       CHI   TEN      Caleb Williams 
#> # ℹ 141 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>
# }