toCamelCase | R Documentation |
Converts a string of words into a merged camel-cased word, e.g. "a single espresso" is converted to "aSingleEspresso".
## Default S3 method:
toCamelCase(s, capitalize=FALSE, preserveSameCase=FALSE, split="[ \t]+", ...)
s |
A |
capitalize |
If |
preserveSameCase |
If |
split |
A pattern used to identify words. See |
... |
Not used. |
Returns a character
vector
.
Henrik Bengtsson
capitalize
.
chartr
().
s <- "hello world"
print(toCamelCase(s)) # helloWorld
print(toCamelCase(s, capitalize=TRUE)) # HelloWorld
stopifnot(toCamelCase(s) == toCamelCase(toCamelCase(s)))
s <- "GEO Accession"
print(toCamelCase(s)) # gEOAccession
print(toCamelCase(s, preserveSameCase=TRUE)) # geoAccession
print(toCamelCase(s, capitalize=TRUE)) # GEOAccession
print(toCamelCase(s, capitalize=TRUE, preserveSameCase=TRUE)) # GEOAccession
stopifnot(toCamelCase(s) == toCamelCase(toCamelCase(s)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.