toCamelCase {R.utils}R Documentation

Converts a string of words into a merged camel-cased word

Description

Converts a string of words into a merged camel-cased word, e.g. "a short black" is converted to "aShortBlack".

Usage

## Default S3 method:
toCamelCase(s, capitalize=FALSE, split="[      ]+", ...)

Arguments

s A character string.
capitalize If TRUE, the first letter will be in upper case, otherwise it will be in lower case.
split A pattern used to identify words. See strsplit() for more details.
... Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

capitalize and decapitalize. chartr().

Examples

  s <- "hello world"
  print(toCamelCase(s))  # helloWorld
  stopifnot(toCamelCase(s) == toCamelCase(toCamelCase(s)))

[Package R.utils version 1.1.1 Index]