Created
November 14, 2023 00:16
-
-
Save njtierney/001f8217e5788819c8a5fde897e3b377 to your computer and use it in GitHub Desktop.
This file contains 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
clean_site_name_forbes <- function(site_name, out_name){ | |
dplyr::case_when( | |
str_detect(site_name, "ST") ~ "STP Forbes", | |
str_detect(site_name, "Muddy") ~ "STP Forbes", | |
str_detect("ST", site_name) ~ "STP Forbes", | |
.default = "unmatched" | |
) | |
} | |
site_name_rules <- function(site_name, site_loc, out_name){ | |
# wrap all of the name changes into a function | |
switch(site_loc, | |
Forbes = clean_site_name_forbes(site_name), | |
Penrith = clean_site_name_penrith(site_name) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment