R/camelCase.R

Defines functions toCamel camelCase

camelCase <- function(x) {
  gsub("_(.)", "\\U\\1", x, perl = TRUE)
}

toCamel <- function(x) {
  if (is.list(x)) {
    x[] <- lapply(x, toCamel)
  }

  if (!is.null(names(x))) {
    names(x) <- camelCase(names(x))
  }

  x
}
hadley/bigrquery documentation built on April 18, 2024, 7:48 p.m.