calculate_stats {nflfastR} | R Documentation |
Calculate NFL Stats
Description
Compute various NFL stats based off nflverse Play-by-Play data.
Usage
calculate_stats(
seasons = nflreadr::most_recent_season(),
summary_level = c("season", "week"),
stat_type = c("player", "team"),
season_type = c("REG", "POST", "REG+POST")
)
Arguments
seasons |
A numeric vector of 4-digit years associated with given NFL seasons - defaults to latest season. If set to TRUE, returns all available data since 1999. |
summary_level |
Summarize stats by |
stat_type |
Calculate |
season_type |
One of |
Value
A tibble of player/team stats summarized by season/week.
See Also
nfl_stats_variables for a description of all variables.
https://www.nflfastr.com/articles/stats_variables.html for a searchable table of the stats variable descriptions.
Examples
try({# to avoid CRAN test problems
stats <- calculate_stats(2023, "season", "player")
dplyr::glimpse(stats)
})
[Package nflfastR version 5.1.0 Index]