From 99c84f7ebaa61703f56f039594b019fbad12cdbe Mon Sep 17 00:00:00 2001 From: Ben Baldwin <1425357+guga31bb@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:10:00 -0400 Subject: [PATCH] injury update line removal --- DESCRIPTION | 2 +- R/helper_scrape_nfl.R | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fb560082..4e8b3b14 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.6.1.9013 +Version: 4.6.1.9014 Authors@R: c(person(given = "Sebastian", family = "Carl", diff --git a/R/helper_scrape_nfl.R b/R/helper_scrape_nfl.R index 147b5854..66d1207c 100644 --- a/R/helper_scrape_nfl.R +++ b/R/helper_scrape_nfl.R @@ -221,6 +221,11 @@ get_pbp_nfl <- function(id, dplyr::filter( !(is.na(.data$timeout_team) & stringr::str_detect(tolower(.data$play_description), "timeout at|two-minute")) ) %>% + # Data in 2024 pbp introduced separate "plays" for injury updates + # 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), "\\*\\* injury update:")) + ) %>% fix_posteams() # fix for games where home_team == away_team and fields are messed up