Skip to content

Commit

Permalink
fix SB week logic for 2021+ (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb authored Oct 17, 2023
1 parent e7547cd commit 0df81eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/update_pbp_participation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 0df81eb

Please sign in to comment.