View source: R/calculate_stats.R
calculate_stats | R Documentation |
Compute various NFL stats based off nflverse Play-by-Play data.
calculate_stats(
seasons = nflreadr::most_recent_season(),
summary_level = c("season", "week"),
stat_type = c("player", "team"),
season_type = c("REG", "POST", "REG+POST")
)
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 |
A tibble of player/team stats summarized by season/week.
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.
try({# to avoid CRAN test problems
stats <- calculate_stats(2023, "season", "player")
dplyr::glimpse(stats)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.