Skip to content

Commit

Permalink
clean desc
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Aug 12, 2024
1 parent f0c78fc commit d6be74a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/helper_scrape_nfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ get_pbp_nfl <- function(id,
dplyr::mutate_if(is.factor, as.character) %>%
# The abbreviations SD <-> LAC and JAC <-> JAX are mixed up in the raw json data
# to make sure team names match, we normalize the names here
# We also remove new line characters esp. from desc
dplyr::mutate_if(
.predicate = is.character,
.funs = ~ stringr::str_replace_all(.x, "JAC", "JAX") %>% stringr::str_replace_all("SD", "LAC")
.funs = ~ team_name_fn(.x) %>% stringr::str_replace_all("[\r\n]", " ") %>% stringr::str_squish()
) %>%
janitor::clean_names() %>%
dplyr::select(-"drive_play_count", -"drive_time_of_possession", -"next_play_type") %>%
Expand Down

0 comments on commit d6be74a

Please sign in to comment.