R/utils.R

Defines functions str_replace_clean clean_names

clean_names <- function(x) {
  x <- tolower(x)
  map_chr(
    x,
    \(x) {
      out <- str_replace_clean(x, " ")
      out <- str_replace_clean(out, "\\:")
      out
    }
  )
}

str_replace_clean <- function(x, y, z = "_") {
  xs <- strsplit(x, y)[[1]]
  paste0(xs, collapse = z)
}

Try the mall package in your browser

Any scripts or data that you put into this service are public.

mall documentation built on Oct. 24, 2024, 5:09 p.m.