R/format_label.R

Defines functions format_label

format_label <- function(x) {

  if (fcaR_options("escape_")) {

    regex <- "([#%&_])"

  } else {

    regex <- "([#%&])"

  }

  x %>%
    stringr::str_replace_all(
      regex,
      "\\\\\\1"
    )

}

Try the fcaR package in your browser

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

fcaR documentation built on May 29, 2024, 2:05 a.m.