From 0df81eb9e842a31080446faba82a472474623fff Mon Sep 17 00:00:00 2001 From: mrcaseb <38586519+mrcaseb@users.noreply.github.com> Date: Tue, 17 Oct 2023 20:02:41 +0200 Subject: [PATCH] fix SB week logic for 2021+ (#84) --- R/update_pbp_participation.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/update_pbp_participation.R b/R/update_pbp_participation.R index 4e90c5ac5..ffb091ec3 100644 --- a/R/update_pbp_participation.R +++ b/R/update_pbp_participation.R @@ -11,9 +11,9 @@ pbp_participation <- dplyr::transmute( game_id = as.character(game_id), # SB exception - week = dplyr::case_when(!!season <= 2021 & week == 22 ~ 21, - !!season >= 2022 & week == 23 ~ 22, - T ~ week), + week = dplyr::case_when(!!season < 2021 & week == 22 ~ 21, + !!season >= 2021 & week == 23 ~ 22, + TRUE ~ week), nflverse_game_id = paste(season, stringr::str_pad(week,2,side = "left",0), visitor_team_abbr, @@ -39,9 +39,9 @@ pbp_participation <- dplyr::mutate( game_id = as.character(game_id), # SB exception - week = dplyr::case_when(!!season <= 2021 & week == 22 ~ 21, - !!season >= 2022 & week == 23 ~ 22, - T ~ week), + week = dplyr::case_when(!!season < 2021 & week == 22 ~ 21, + !!season >= 2021 & week == 23 ~ 22, + TRUE ~ week), players_on_play2 = players_on_play) |> dplyr::select( old_game_id = game_id,