R/util_bQuote.R

Defines functions util_bQuote

Documented in util_bQuote

#' Put in back-ticks
#'
#' also escape potential back-ticks in x
#'
#' @param x a string
#'
#' @return x in back-ticks
util_bQuote <- function(x) {
  if (length(x) == 0)
    return(character(0))
  nna <- !is.na(x)
  x[nna] <- gsub("\\", "\\\\", x[nna], fixed = TRUE)
  x[nna] <- gsub("`", "\\`", x[nna], fixed = TRUE)
  x[nna] <- paste0("`", x[nna], "`")
  x
}

Try the dataquieR package in your browser

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

dataquieR documentation built on July 26, 2023, 6:10 p.m.