## devtools::install_github("meysubb/cfbscrapR")
library(cfbscrapR)
#> Warning: replacing previous import 'mgcv::multinom' by 'nnet::multinom' when
#> loading 'cfbscrapR'
library(tidyverse)
year = 2001:2019
week = 1:14
df = expand.grid(year, week) %>% setNames(c('year', 'week'))
df %>%
mutate(pbp = purrr::pmap(
list(x = year,
y = week),
.f = function(x, y) {
cfb_pbp_data(
year = x,
week = y,
team = "Pittsburgh",
epa_wpa = TRUE
)
}
)) -> pitt
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in log(adj_yd_line): NaNs produced
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in log(adj_yd_line): NaNs produced
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Warning in cfb_pbp_data(year = x, week = y, team = "Pittsburgh", epa_wpa = TRUE): Most likely a bye week, the data pulled from the API was empty. Returning nothing
#> for this one week or team.
#> Error in `[<-.data.frame`(`*tmp*`, kickoff_ind, "ep_before", value = c(0, : replacement has 7 rows, data has 1
Created on 2019-12-29 by the reprex package (v0.3.0)