View source: R/aggregate_game_stats_def.R
calculate_player_stats_def | R Documentation |
Build columns that aggregate official defense stats either at the game level or at the level of the entire data frame passed.
calculate_player_stats_def(pbp, weekly = FALSE)
pbp |
A Data frame of NFL play-by-play data typically loaded with
|
weekly |
If |
A data frame of defensive player stats. See dictionary (# TODO)
The function load_player_stats()
and the corresponding examples
on the nflfastR website
try({# to avoid CRAN test problems
pbp <- nflfastR::load_pbp(2020)
weekly <- calculate_player_stats_def(pbp, weekly = TRUE)
dplyr::glimpse(weekly)
overall <- calculate_player_stats_def(pbp, weekly = FALSE)
dplyr::glimpse(overall)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.