Skip to contents

Load Player Level Weekly Stats

Usage

load_player_stats(...)

Arguments

...

Arguments passed on to nflreadr::load_player_stats

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

The function calculate_player_stats() and the corresponding examples on the nflfastR website

Examples

# \donttest{
try({# to avoid CRAN test problems
stats <- load_player_stats()
dplyr::glimpse(stats)
})
#> Warning: We have changed the behavior of `load_player_stats()` as of nflfastR 4.3.0.
#> Calling it without an argument will return the current season only instead of
#> all available seasons.
#> Please try `load_player_stats(seasons = TRUE)` to get all seasons.
#> This warning is displayed once every 8 hours.
#> Rows: 1,865
#> Columns: 53
#> $ player_id                   <chr> "00-0023459", "00-0024243", "00-0026498", …
#> $ player_name                 <chr> "A.Rodgers", "M.Lewis", "M.Stafford", "M.S…
#> $ player_display_name         <chr> "Aaron Rodgers", "Marcedes Lewis", "Matthe…
#> $ position                    <chr> "QB", "TE", "QB", "QB", "QB", "QB", "QB", …
#> $ position_group              <chr> "QB", "TE", "QB", "QB", "QB", "QB", "QB", …
#> $ headshot_url                <chr> "https://static.www.nfl.com/image/private/…
#> $ recent_team                 <chr> "NYJ", "CHI", "LA", "LA", "LA", "LA", "LA"…
#> $ season                      <int> 2023, 2023, 2023, 2023, 2023, 2023, 2023, …
#> $ week                        <int> 1, 4, 1, 2, 3, 4, 5, 6, 6, 3, 5, 3, 3, 5, …
#> $ season_type                 <chr> "REG", "REG", "REG", "REG", "REG", "REG", …
#> $ completions                 <int> 0, 0, 24, 34, 18, 27, 21, 15, 6, 0, 0, 3, …
#> $ attempts                    <int> 1, 0, 38, 55, 33, 40, 37, 24, 10, 0, 0, 5,…
#> $ passing_yards               <dbl> 0, 0, 334, 307, 269, 319, 222, 226, 102, 0…
#> $ passing_tds                 <int> 0, 0, 0, 1, 1, 1, 2, 1, 0, 0, 0, 0, 2, 0, …
#> $ interceptions               <dbl> 0, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 2, 0, 0, …
#> $ sacks                       <dbl> 1, 0, 0, 1, 6, 2, 4, 3, 0, 0, 0, 0, 3, 0, …
#> $ sack_yards                  <dbl> 10, 0, 0, 10, 48, 16, 27, 23, 0, 0, 0, 0, …
#> $ sack_fumbles                <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ sack_fumbles_lost           <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ passing_air_yards           <dbl> 17, 0, 409, 363, 317, 297, 366, 191, 120, …
#> $ passing_yards_after_catch   <dbl> 0, 0, 106, 144, 99, 114, 90, 84, 24, 0, 0,…
#> $ passing_first_downs         <dbl> 0, 0, 17, 17, 12, 16, 13, 7, 4, 0, 0, 2, 1…
#> $ passing_epa                 <dbl> -2.0319599, NA, 20.6799815, -5.0891927, -8…
#> $ passing_2pt_conversions     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ pacr                        <dbl> 0.0000000, NA, 0.8166259, 0.8457300, 0.848…
#> $ dakota                      <dbl> NA, NA, 0.21719006, -0.02970462, -0.010766…
#> $ carries                     <int> 0, 0, 3, 4, 1, 2, 0, 1, 3, 0, 0, 2, 2, 1, …
#> $ rushing_yards               <dbl> 0, 0, 11, 17, 7, 14, 0, 2, -3, 0, 0, -1, 1…
#> $ rushing_tds                 <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ rushing_fumbles             <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ rushing_fumbles_lost        <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ rushing_first_downs         <dbl> 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, …
#> $ rushing_epa                 <dbl> NA, NA, 0.8680859, -0.4383297, 2.5295763, …
#> $ rushing_2pt_conversions     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receptions                  <int> 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, …
#> $ targets                     <int> 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, …
#> $ receiving_yards             <dbl> 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, …
#> $ receiving_tds               <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, …
#> $ receiving_fumbles           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receiving_fumbles_lost      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receiving_air_yards         <dbl> 0, -3, 0, 0, 0, 0, 0, 0, 0, 8, 6, 0, 0, 0,…
#> $ receiving_yards_after_catch <dbl> 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ receiving_first_downs       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, …
#> $ receiving_epa               <dbl> NA, 0.4834648, NA, NA, NA, NA, NA, NA, NA,…
#> $ receiving_2pt_conversions   <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ racr                        <dbl> NA, 0.0000000, NA, NA, NA, NA, NA, NA, NA,…
#> $ target_share                <dbl> NA, 0.03125000, NA, NA, NA, NA, NA, NA, NA…
#> $ air_yards_share             <dbl> NA, -0.01239669, NA, NA, NA, NA, NA, NA, N…
#> $ wopr                        <dbl> NA, 0.03819731, NA, NA, NA, NA, NA, NA, NA…
#> $ special_teams_tds           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ fantasy_points              <dbl> 0.00, 0.80, 14.46, 13.98, 11.46, 16.16, 16…
#> $ fantasy_points_ppr          <dbl> 0.00, 1.80, 14.46, 13.98, 11.46, 16.16, 16…
#> $ opponent_team               <chr> "BUF", "DEN", "SEA", "SF", "CIN", "IND", "…
# }