toCamelCase.Rd
Converts a string of words into a merged camel-cased word, e.g. "a single espresso" is converted to "aSingleEspresso".
# S3 method for default
toCamelCase(s, capitalize=FALSE, preserveSameCase=FALSE, split="[ \t]+", ...)
capitalize
.
chartr
().
s <- "hello world"
print(toCamelCase(s)) # helloWorld
#> [1] "helloWorld"
print(toCamelCase(s, capitalize=TRUE)) # HelloWorld
#> [1] "HelloWorld"
stopifnot(toCamelCase(s) == toCamelCase(toCamelCase(s)))
s <- "GEO Accession"
print(toCamelCase(s)) # gEOAccession
#> [1] "gEOAccession"
print(toCamelCase(s, preserveSameCase=TRUE)) # geoAccession
#> [1] "geoAccession"
print(toCamelCase(s, capitalize=TRUE)) # GEOAccession
#> [1] "GEOAccession"
print(toCamelCase(s, capitalize=TRUE, preserveSameCase=TRUE)) # GEOAccession
#> [1] "GEOAccession"
stopifnot(toCamelCase(s) == toCamelCase(toCamelCase(s)))