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")
)

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

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: 2022-03-08 18:19:14 UTC
#> # A tibble: 706 × 24
#>    game_id     pfr_game_id season  week game_type team  opponent pfr_player_name
#>    <chr>       <chr>        <int> <int> <chr>     <chr> <chr>    <chr>          
#>  1 2021_01_DA… 202109090t…   2021     1 REG       TB    DAL      Tom Brady      
#>  2 2021_01_DA… 202109090t…   2021     1 REG       DAL   TB       Dak Prescott   
#>  3 2021_01_PH… 202109120a…   2021     1 REG       ATL   PHI      Matt Ryan      
#>  4 2021_01_PH… 202109120a…   2021     1 REG       PHI   ATL      Jalen Hurts    
#>  5 2021_01_PI… 202109120b…   2021     1 REG       BUF   PIT      Josh Allen     
#>  6 2021_01_PI… 202109120b…   2021     1 REG       PIT   BUF      Ben Roethlisbe…
#>  7 2021_01_NY… 202109120c…   2021     1 REG       CAR   NYJ      Sam Darnold    
#>  8 2021_01_NY… 202109120c…   2021     1 REG       NYJ   CAR      Zach Wilson    
#>  9 2021_01_MI… 202109120c…   2021     1 REG       CIN   MIN      Joe Burrow     
#> 10 2021_01_MI… 202109120c…   2021     1 REG       MIN   CIN      Kirk Cousins   
#> # … with 696 more rows, and 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>
# }