Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created November 14, 2023 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njtierney/001f8217e5788819c8a5fde897e3b377 to your computer and use it in GitHub Desktop.
Save njtierney/001f8217e5788819c8a5fde897e3b377 to your computer and use it in GitHub Desktop.
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