upperCamelCase: Upper camel case

upperCamelCaseR Documentation

Upper camel case

Description

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

Usage

upperCamelCase(object, ...)

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

Arguments

object

Object.

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.

smart

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

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.

...

Additional arguments.

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.

Value

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

Note

Updated 2021-08-24.

Examples

data(syntactic, package = "AcidTest")
object <- syntactic$character
upperCamelCase(object)

acidgenomics/r-syntactic documentation built on Oct. 30, 2023, 3:08 a.m.