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

.for_cran()
# \donttest{
try({ # prevents cran errors
  load_player_stats()
  load_player_stats(stat_type = "kicking")
})
#> ── nflverse player stats: kicking ──────────────────────────────────────────────
#>  Data updated: 2023-10-11 09:10:33 UTC
#> # A tibble: 156 × 40
#>    season  week season_type team  player_name player_id  fg_made fg_missed
#>     <int> <int> <chr>       <chr> <chr>       <chr>        <int>     <int>
#>  1   2023     1 REG         ARI   M.Prater    00-0023853       3         0
#>  2   2023     1 REG         ATL   Y.Koo       00-0033702       1         0
#>  3   2023     1 REG         BAL   J.Tucker    00-0029597       1         0
#>  4   2023     1 REG         BUF   T.Bass      00-0036162       3         0
#>  5   2023     1 REG         CAR   E.Pineiro   00-0034173       1         0
#>  6   2023     1 REG         CHI   C.Santos    00-0031203       2         0
#>  7   2023     1 REG         CIN   E.McPherson 00-0036854       1         1
#>  8   2023     1 REG         CLE   D.Hopkins   00-0030098       3         0
#>  9   2023     1 REG         DAL   B.Aubrey    00-0037692       2         0
#> 10   2023     1 REG         DEN   W.Lutz      00-0032569       1         1
#> # ℹ 146 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>, …
# }