Skip to content

Commit

Permalink
Fix broken goal to go variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Mar 6, 2024
1 parent 623b4c6 commit ca7e539
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/helper_scrape_nfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ get_pbp_nfl <- function(id,
safety_team = ifelse(
.data$safety == 1 & .data$season <= 2015 & (.data$home_team %in% c("JAC", "JAX") | .data$away_team %in% c("JAC", "JAX")),
ifelse(.data$posteam == .data$home_team, .data$away_team, .data$home_team), .data$safety_team
)
),

# can't trust the goal_to_go variable so we overwrite it here
goal_to_go = as.integer(stringr::str_detect(tolower(.data$pre_play_by_play), "goal"))

) %>%
dplyr::mutate_if(
Expand Down

0 comments on commit ca7e539

Please # to comment.