ignore <- c("enforced between downs.")
pbp_raw <- load_pbp(2021) %>%
filter(season == 2021) %>%
filter(season_type == "REG") %>%
filter(play_type != "no_play" | str_detect(desc, paste(ignore, collapse = "|"))) %>%
filter(!(str_detect(desc, "enforced between downs.") & str_detect(desc, "Kick formation"))) %>%
filter(!(str_detect(desc, "enforced between downs.") & str_detect(desc, "No Play.")))
pbp_raw$new_play_num <- ave(pbp_raw$play_id ,pbp_raw$game_id,FUN = seq_along)
pbp_raw <- pbp_raw %>%
mutate(UNIQUE_PLAY_ID = paste(game_id, new_play_num, sep = "_"))