Skip to contents

Load Player Level Weekly Stats

Usage

load_player_stats(
  seasons = most_recent_season(),
  stat_type = c("offense", "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 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: 2023-02-28 09:28:01 UTC
#> # A tibble: 565 × 40
#>    season  week season_type team  player_name player_id  fg_made fg_missed
#>     <int> <int> <chr>       <chr> <chr>       <chr>        <int>     <int>
#>  1   2022     1 REG         ARI   M.Prater    00-0023853       0         0
#>  2   2022     1 REG         ATL   Y.Koo       00-0033702       4         0
#>  3   2022     1 REG         BAL   J.Tucker    00-0029597       1         0
#>  4   2022     1 REG         BUF   T.Bass      00-0036162       1         0
#>  5   2022     1 REG         CAR   E.Pineiro   00-0034173       1         0
#>  6   2022     1 REG         CHI   C.Santos    00-0031203       0         0
#>  7   2022     1 REG         CIN   E.McPherson 00-0036854       2         1
#>  8   2022     1 REG         CLE   C.York      00-0038097       4         0
#>  9   2022     1 REG         DAL   B.Maher     00-0030332       1         0
#> 10   2022     1 REG         DEN   B.McManus   00-0029822       3         1
#> # ℹ 555 more rows
#> # ℹ 32 more variables: fg_blocked <int>, fg_long <dbl>, fg_att <dbl>,
#> #   fg_pct <dbl>, pat_made <int>, pat_missed <int>, pat_blocked <int>,
#> #   pat_att <dbl>, pat_pct <dbl>, fg_made_distance <dbl>,
#> #   fg_missed_distance <dbl>, fg_blocked_distance <dbl>, gwfg_att <int>,
#> #   gwfg_distance <dbl>, gwfg_made <int>, gwfg_missed <int>,
#> #   gwfg_blocked <int>, fg_made_0_19 <dbl>, fg_made_20_29 <dbl>, …
# }