Created
November 10, 2022 21:39
-
-
Save JosiahParry/8d28947999783aef4cde3f1b25f86515 to your computer and use it in GitHub Desktop.
tidy up route names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_route_name <- function(x) { | |
strsplit(x, ", ") |> | |
unlist() |> | |
unique() |> | |
paste(collapse = ", ") | |
} | |
routes <- c("426, 442, 450, 455, T116", "113, 99, T109, T110") | |
make_route_name(routes) | |
#> [1] "426, 442, 450, 455, T116, 113, 99, T109, T110" |
worked beautifully - thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this funciton within your dplyr mutate call.
Something like