diff --git a/DESCRIPTION b/DESCRIPTION index f118bf67..86f720ef 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: nflfastR Title: Functions to Efficiently Access NFL Play by Play Data -Version: 4.5.1.9010 +Version: 4.5.1.9011 Authors@R: c(person(given = "Sebastian", family = "Carl", diff --git a/NEWS.md b/NEWS.md index b7cb745c..54bd6505 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,7 @@ - Added the new function `save_raw_pbp()` which efficiently downloads raw play-by-play data and saves it to the local file system. This serves as a helper to setup the system for faster play-by-play parsing via the above functionality. (#423) - Added the new function `missing_raw_pbp()` that computes a vector of game IDs missing in the local raw play-by-play directory. (#423) - Decode player IDs in 2023 pbp. (#425) +- Drop the pseudo plays TV Timeout and Two-Minute Warning. (#426) # nflfastR 4.5.1 diff --git a/R/helper_scrape_nfl.R b/R/helper_scrape_nfl.R index 61236b70..67926661 100644 --- a/R/helper_scrape_nfl.R +++ b/R/helper_scrape_nfl.R @@ -288,6 +288,11 @@ get_pbp_nfl <- function(id, .predicate = is.character, .funs = ~dplyr::na_if(.x, "") ) %>% + # Data in 2023 pbp introduced separate "plays" for TV timeouts and two minute warnings + # These mess up some of our logic. Since they are useless, we remove them here + dplyr::filter( + !(is.na(.data$timeout_team) & stringr::str_detect(tolower(.data$play_description), "timeout at|two-minute")) + ) %>% fix_posteams() # fix for games where home_team == away_team and fields are messed up diff --git a/tests/testthat/expected_pbp.rds b/tests/testthat/expected_pbp.rds index 8f73efdf..6443057a 100644 Binary files a/tests/testthat/expected_pbp.rds and b/tests/testthat/expected_pbp.rds differ