Upper camel case

# S4 method for ANY
upperCamel(object, strict = FALSE)

# S4 method for character
upperCamel(object, strict = FALSE)

# S4 method for factor
upperCamel(object, strict = FALSE)

# S4 method for matrix
upperCamel(object, rownames = FALSE,
  colnames = TRUE, strict = FALSE)

# S4 method for Matrix
upperCamel(object, rownames = FALSE,
  colnames = TRUE, strict = FALSE)

# S4 method for data.frame
upperCamel(object, rownames = FALSE,
  colnames = TRUE, strict = FALSE)

# S4 method for DataFrame
upperCamel(object, rownames = FALSE,
  colnames = TRUE, strict = FALSE)

# S4 method for GRanges
upperCamel(object, strict = FALSE)

# S4 method for GRangesList
upperCamel(object, strict = FALSE)

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.

rownames

logical(1). Apply sanitization on row names. This is not generally recommended by default, since rownames commonly contain gene identifiers that should not be modified.

colnames

logical(1). Apply sanitization on column names. This is generally 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.

Examples

load(system.file("extdata", "mn.rda", package = "syntactic")) lapply(mn, upperCamel)
#> $character #> [1] "HelloWorld" "HELLOWORLD" "RNAIClones" "NCount" #> [5] "Tx2gene" "TX2GeneID" "G2MScore" "WorfdbHTMLRemap" #> [9] "MazdaRX4" "PercentGC" "X5prime" "X5X3Bias" #> [13] "X123" NA #> #> $namedCharacter #> ItemA ItemB #> "HelloWorld" "HELLOWORLD" #> #> $factor #> Sample1 Sample2 Sample3 Sample4 #> Group1 Group1 Group2 Group2 #> Levels: Group1 Group2 #> #> $dataFrame #> Murder Assault UrbanPop Rape #> Alabama 13.2 236 58 21.2 #> Alaska 10.0 263 48 44.5 #> Arizona 8.1 294 80 31.0 #> Arkansas 8.8 190 50 19.5 #> California 9.0 276 91 40.6 #> Colorado 7.9 204 78 38.7 #> #> $matrix #> Murder Assault UrbanPop Rape #> Alabama 13.2 236 58 21.2 #> Alaska 10.0 263 48 44.5 #> Arizona 8.1 294 80 31.0 #> Arkansas 8.8 190 50 19.5 #> California 9.0 276 91 40.6 #> Colorado 7.9 204 78 38.7 #> #> $tibble #> # A tibble: 6 x 11 #> Manufacturer Model Displ Year Cyl Trans Drv Cty Hwy Fl Class #> <chr> <chr> <dbl> <int> <int> <chr> <chr> <int> <int> <chr> <chr> #> 1 audi a4 1.8 1999 4 auto(l5) f 18 29 p compa… #> 2 audi a4 1.8 1999 4 manual(m5) f 21 29 p compa… #> 3 audi a4 2 2008 4 manual(m6) f 20 31 p compa… #> 4 audi a4 2 2008 4 auto(av) f 21 30 p compa… #> 5 audi a4 2.8 1999 6 auto(l5) f 16 26 p compa… #> 6 audi a4 2.8 1999 6 manual(m5) f 18 26 p compa… #> #> $list #> $list$ItemA #> [1] 1 2 #> #> $list$ItemB #> [1] 3 4 #> #>