Format character strings to use (lower) camel-style formatting, where word boundaries are defined by capitlization only (e.g. thisIsCamelCase).

camelCase(object, ...)

# S4 method for character
camelCase(
  object,
  rename = FALSE,
  recursive = FALSE,
  smart = TRUE,
  strict = FALSE,
  names = !rename,
  prefix = !rename
)

camel(...)

Arguments

object

Object.

...

Additional arguments.

rename

logical(1). File rename mode. Requires that input contains files and/or directories that exist on disk. Both case-sensitive (e.g. Linux) and -insensitive (e.g. macOS, Winddows) file systems are supported.

The prefix and smart arguments are supported in this mode.

recursive

logical(1). Should the function recurse into directories? Only applicable when rename = TRUE.

smart

logical(1). Handle complicated special cases, such as mixed case acronyms, plus/minus, percentages, etc.

strict

logical(1). Enforce strict name sanitization. When TRUE, this does not allow the return of any capitalized acronyms. "RNA" will become "Rna", for example.

names

logical(1). Sanitize names.

Only applies to string mode (rename = FALSE).

prefix

logical(1). Prepend "X" character if necessary, when string begins with a syntactically invalid character, such as a number or non-alphanumeric. Note that names are always made syntactically valid when applicable with "X" prefix. See make.names() for details.

Enabled by default for string mode, but disabled by default for rename mode, when applicable.

Value

Modified object. Contains syntatically valid names. For objects supporting names(), the underlying data returns unchanged, except for character or vector class. Returns invisible modified file path when rename = TRUE. Returns invisible NULL when recursive = TRUE.

Details

Camel case is recommended by Bioconductor for variable and function names.

Note

Updated 2019-12-05.

Examples

data(syntactic, package = "acidtest") object <- syntactic$character camelCase(object)
#> [1] "percentGC" "x10um" "x5x3Bias" "x5prime" #> [5] "g2mScore" "helloWorld" "helloWORLD" "mazdaRX4" #> [9] "nCount" "rnaiClones" "tx2gene" "tx2GeneID" #> [13] "worfdbHTMLRemap" "x123"