Skip to contents

Load Player Level Weekly Stats

Usage

load_player_stats(
  seasons = most_recent_season(),
  stat_type = c("offense", "defense", "kicking"),
  file_type = getOption("nflreadr.prefer", default = "rds")
)

Arguments

seasons

a numeric vector of seasons to return, defaults to most recent season. If set to TRUE, returns all available data.

stat_type

one of "offense", "defense", or "kicking"

file_type

One of c("rds", "qs", "csv", "parquet"). Can also be set globally with options(nflreadr.prefer)

Value

A tibble of week-level player statistics that aims to match NFL official box scores.

See also

https://nflreadr.nflverse.com/articles/dictionary_player_stats.html for a web version of the data dictionary

dictionary_player_stats for the data dictionary

Issues with this data should be filed here: https://github.com/nflverse/nflverse-pbp

Examples

# \donttest{
try({ # prevents cran errors
  load_player_stats()
  load_player_stats(stat_type = "kicking")
})
#> ── nflverse player stats: kicking ──────────────────────────────────────────────
#>  Data updated: 2024-11-12 09:24:46 UTC
#> # A tibble: 305 × 44
#>    season  week season_type player_id  team  player_name player_display_name
#>     <int> <int> <chr>       <chr>      <chr> <chr>       <chr>              
#>  1   2024     1 REG         00-0023853 ARI   M.Prater    Matt Prater        
#>  2   2024     2 REG         00-0023853 ARI   M.Prater    Matt Prater        
#>  3   2024     3 REG         00-0023853 ARI   M.Prater    Matt Prater        
#>  4   2024     4 REG         00-0023853 ARI   M.Prater    Matt Prater        
#>  5   2024     1 REG         00-0025565 TEN   N.Folk      Nick Folk          
#>  6   2024     2 REG         00-0025565 TEN   N.Folk      Nick Folk          
#>  7   2024     3 REG         00-0025565 TEN   N.Folk      Nick Folk          
#>  8   2024     4 REG         00-0025565 TEN   N.Folk      Nick Folk          
#>  9   2024     6 REG         00-0025565 TEN   N.Folk      Nick Folk          
#> 10   2024     7 REG         00-0025565 TEN   N.Folk      Nick Folk          
#> # ℹ 295 more rows
#> # ℹ 37 more variables: position <chr>, position_group <chr>,
#> #   headshot_url <chr>, fg_made <int>, fg_att <dbl>, fg_missed <int>,
#> #   fg_blocked <int>, fg_long <dbl>, fg_pct <dbl>, fg_made_0_19 <int>,
#> #   fg_made_20_29 <int>, fg_made_30_39 <int>, fg_made_40_49 <int>,
#> #   fg_made_50_59 <int>, fg_made_60_ <int>, fg_missed_0_19 <int>,
#> #   fg_missed_20_29 <int>, fg_missed_30_39 <int>, fg_missed_40_49 <int>, …
# }