This function summarizes the EP data up to the game level
Usage
ep_summarize(
predicted_pbp,
stat_type = c("all", "expected_points", "team_stats")
)
Arguments
- predicted_pbp
list with dataframes created by
ep_predict
- stat_type
options to limit the columns returned by
ep_summarize
- available options are "all", "expected_points", and "team stats"
Examples
# \donttest{
try({
predicted <- readRDS(system.file("ep_predicted.rds",package = "ffopportunity"))
# equivalent to nflreadr::load_pbp(2021) %>% head(100) %>% ep_preprocess() %>% ep_predict()
ep_summarize(predicted)
})
#> # A tibble: 124 × 159
#> season posteam week game_id playe…¹ full_…² posit…³ pass_…⁴ rec_a…⁵ rush_…⁶
#> <chr> <chr> <dbl> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 2021 TEN 1 2021_01… 00-002… Ryan T… QB 35 0 2
#> 2 2021 TEN 1 2021_01… 00-003… Derric… RB 0 4 17
#> 3 2021 TEN 1 2021_01… 00-003… Cheste… WR 0 6 0
#> 4 2021 ARI 1 2021_01… 00-003… Kyler … QB 32 0 5
#> 5 2021 ARI 1 2021_01… 00-003… DeAndr… WR 0 8 0
#> 6 2021 ARI 1 2021_01… 00-003… Chase … RB 0 4 12
#> 7 2021 ARI 1 2021_01… 00-002… A.J. G… WR 0 6 0
#> 8 2021 ARI 1 2021_01… 00-003… Christ… WR 0 5 0
#> 9 2021 ARI 1 2021_01… 00-003… Rondal… WR 0 5 0
#> 10 2021 ARI 1 2021_01… 00-003… Demetr… TE 0 3 0
#> # … with 114 more rows, 149 more variables: pass_air_yards <dbl>,
#> # rec_air_yards <dbl>, pass_completions <dbl>, receptions <dbl>,
#> # pass_completions_exp <dbl>, receptions_exp <dbl>, pass_yards_gained <dbl>,
#> # rec_yards_gained <dbl>, rush_yards_gained <dbl>,
#> # pass_yards_gained_exp <dbl>, rec_yards_gained_exp <dbl>,
#> # rush_yards_gained_exp <dbl>, pass_touchdown <dbl>, rec_touchdown <dbl>,
#> # rush_touchdown <dbl>, pass_touchdown_exp <dbl>, rec_touchdown_exp <dbl>, …
# }