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

upperCamelCase(object, ...)

# S4 method for character
upperCamelCase(object, names = TRUE,
  strict = FALSE, prefix = TRUE, smart = TRUE)

upperCamel(...)

Arguments

object

Object.

...

Additional arguments.

names

logical(1). Sanitize names.

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. Disabled by default.

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. Recommended by default.

smart

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

Value

Modified object. Contains syntatically valid names. For objects supporting names(), the underlying data returns unchanged, except for character or vector class.

Details

Note that lower camel case is generally recommended in R over the use of upper camel case. However, upper camel case is recommended by Bioconductor for S4 class names and corresponding generators, but not variables or functions.

Note

Updated 2019-10-08.

Examples

data(syntactic, package = "acidtest") object <- syntactic$character upperCamelCase(object)
#> [1] "PercentGC" "X10um" "X5X3Bias" "X5prime" #> [5] "G2MScore" "HelloWorld" "HELLOWORLD" "MazdaRX4" #> [9] "NCount" "RNAIClones" "Tx2gene" "TX2GeneID" #> [13] "WorfdbHTMLRemap" "X123" NA