R: CamelCase

tocamel {rapportools} | R Documentation

## CamelCase

### Description

Convert character vector to camelcase - capitalise first letter of each word.

### Usage

    tocamel(x, delim = "[^[:alnum:]]", upper = FALSE, sep = "", ...)

### Arguments

`x` | a character vector to be converted to camelcase
`delim` | a string containing regular expression word delimiter
`upper` | a logical value indicating if the first letter of the first word should be capitalised (defaults to `FALSE`)
`sep` | a string to separate words
`...` | additional arguments to be passed to `strsplit`

### Value

a character vector with strings put in camelcase

### Examples

    tocamel("foo.bar")
        ## [1] "fooBar"

        tocamel("foo.bar", upper = TRUE)
        ## [1] "FooBar"

        tocamel(c("foobar", "foo.bar", "camel_case", "a.b.c.d"))
        ## [1] "foobar"    "fooBar"    "camelCase" "aBCD"

[Package rapportools version 1.0 Index]