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: 328
#> Columns: 53
#> $ player_id                   <chr> "00-0023459", "00-0026498", "00-0028002", …
#> $ player_name                 <chr> "A.Rodgers", "M.Stafford", "R.Cobb", "T.Ta…
#> $ player_display_name         <chr> "Aaron Rodgers", "Matthew Stafford", "Rand…
#> $ position                    <chr> "QB", "QB", "WR", "QB", "QB", "WR", "QB", …
#> $ position_group              <chr> "QB", "QB", "WR", "QB", "QB", "WR", "QB", …
#> $ headshot_url                <chr> "https://static.www.nfl.com/image/private/…
#> $ recent_team                 <chr> "NYJ", "LA", "NYJ", "NYG", "DEN", "DET", "…
#> $ season                      <int> 2023, 2023, 2023, 2023, 2023, 2023, 2023, …
#> $ week                        <int> 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, …
#> $ season_type                 <chr> "REG", "REG", "REG", "REG", "REG", "REG", …
#> $ completions                 <int> 0, 24, 0, 2, 27, 0, 33, 31, 16, 0, 0, 0, 0…
#> $ attempts                    <int> 1, 38, 0, 2, 34, 0, 44, 44, 34, 0, 0, 0, 0…
#> $ passing_yards               <dbl> 0, 334, 0, 6, 177, 0, 344, 364, 198, 0, 0,…
#> $ passing_tds                 <int> 0, 0, 0, 0, 2, 0, 2, 4, 0, 0, 0, 0, 0, 0, …
#> $ interceptions               <dbl> 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, …
#> $ sacks                       <dbl> 1, 0, 0, 0, 2, 0, 2, 2, 3, 0, 0, 0, 0, 0, …
#> $ sack_yards                  <dbl> 10, 0, 0, 0, 11, 0, 16, 18, 17, 0, 0, 0, 0…
#> $ sack_fumbles                <int> 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, …
#> $ sack_fumbles_lost           <int> 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, …
#> $ passing_air_yards           <dbl> 17, 409, 0, -10, 137, 0, 298, 404, 310, 0,…
#> $ passing_yards_after_catch   <dbl> 0, 106, 0, 16, 78, 0, 145, 150, 124, 0, 0,…
#> $ passing_first_downs         <dbl> 0, 17, 0, 0, 11, 0, 15, 19, 8, 0, 0, 0, 0,…
#> $ passing_epa                 <dbl> -2.0319599, 20.6799815, NA, -0.5446569, 2.…
#> $ passing_2pt_conversions     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ pacr                        <dbl> 0.0000000, 0.8166259, NA, 0.0000000, 1.291…
#> $ dakota                      <dbl> NA, 0.21719006, NA, NA, 0.20051344, NA, 0.…
#> $ carries                     <int> 0, 3, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 2, 0, …
#> $ rushing_yards               <dbl> 0, 11, 0, 0, 1, 0, 7, 0, 5, 0, 0, 0, 6, 0,…
#> $ 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, 1, 0, 0, 0, 0, 0, 0, 0, …
#> $ rushing_fumbles_lost        <dbl> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, …
#> $ rushing_first_downs         <dbl> 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, …
#> $ rushing_epa                 <dbl> NA, 0.86808594, NA, NA, -0.60332139, NA, -…
#> $ rushing_2pt_conversions     <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receptions                  <int> 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 6, 0, 6, 6, …
#> $ targets                     <int> 0, 0, 1, 0, 0, 6, 0, 0, 0, 2, 10, 2, 9, 10…
#> $ receiving_yards             <dbl> 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 21, 0, 76, …
#> $ receiving_tds               <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receiving_fumbles           <dbl> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receiving_fumbles_lost      <dbl> 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ receiving_air_yards         <dbl> 0, 0, 10, 0, 0, 50, 0, 0, 0, 9, 56, 86, 10…
#> $ receiving_yards_after_catch <dbl> 0, 0, 0, 0, 0, 4, 0, 0, 0, 3, 6, 0, 26, 21…
#> $ receiving_first_downs       <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 4, …
#> $ receiving_epa               <dbl> NA, NA, -3.9241312, NA, NA, -6.1952312, NA…
#> $ receiving_2pt_conversions   <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ racr                        <dbl> NA, NA, 0.0000000, NA, NA, 0.1600000, NA, …
#> $ target_share                <dbl> NA, NA, 0.05555556, NA, NA, 0.18750000, NA…
#> $ air_yards_share             <dbl> NA, NA, 0.13333333, NA, NA, 0.23041475, NA…
#> $ wopr                        <dbl> NA, NA, 0.17666667, NA, NA, 0.44254032, NA…
#> $ special_teams_tds           <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
#> $ fantasy_points              <dbl> 0.00, 14.46, 0.00, 0.24, 15.18, -1.20, 16.…
#> $ fantasy_points_ppr          <dbl> 0.00, 14.46, 0.00, 0.24, 15.18, 0.80, 16.4…
#> $ opponent_team               <chr> "BUF", "SEA", "BUF", "DAL", "LV", "KC", "T…
# }