Combine mutate() with string manipulation

less than 1 minute read

Combining mutate() with str_replace() and str_remove()

some_tibble %>%
  mutate(New_col = str_replace(Old_col, "pattern", "replacement"))
some_tibble %>%
  mutate(New_col = str_remove_all(Old_col, "pattern to remove"))

Leave a Comment