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", "csv","qs", "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/nflfastR-data

Examples

# \donttest{
try({ # prevents cran errors
  load_player_stats()
  load_player_stats(stat_type = "kicking")
})
#> ── nflverse player stats: kicking ──────────────────────────────────────────────
#>  Data updated: 2022-03-09 20:34:48 UTC
#> # A tibble: 561 × 40
#>    season  week season_type team  player_name  player_id  fg_made fg_missed
#>     <int> <int> <chr>       <chr> <chr>        <chr>        <int>     <int>
#>  1   2021     1 REG         ARI   M.Prater     00-0023853       1         1
#>  2   2021     1 REG         ATL   Y.Koo        00-0033702       2         0
#>  3   2021     1 REG         BAL   J.Tucker     00-0029597       2         0
#>  4   2021     1 REG         BUF   T.Bass       00-0036162       3         0
#>  5   2021     1 REG         CAR   R.Santoso    00-0034648       2         0
#>  6   2021     1 REG         CHI   C.Santos     00-0031203       0         0
#>  7   2021     1 REG         CIN   E.McPherson  00-0036854       2         0
#>  8   2021     1 REG         CLE   C.McLaughlin 00-0035358       0         0
#>  9   2021     1 REG         DAL   G.Zuerlein   00-0029621       3         2
#> 10   2021     1 REG         DEN   B.McManus    00-0029822       2         0
#> # … with 551 more rows, and 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 <dbl>,
#> #   gwfg_distance <dbl>, gwfg_made <dbl>, gwfg_missed <dbl>,
#> #   gwfg_blocked <dbl>, fg_made_0_19 <dbl>, fg_made_20_29 <dbl>,
#> #   fg_made_30_39 <dbl>, fg_made_40_49 <dbl>, fg_made_50_59 <dbl>, …
# }