Takes a character vector, or list object of character vectors and converts the case to camel case. Outputs the same object and number of elements as the input unless the collapseall flag is set to TRUE, in which case it will output a single character vector.

tocamel(x, collapseall = FALSE)

Arguments

x

A character vector, or list object of character vectors.

collapseall

A logical/boolean flag to indicate whether or not you want a single character vector as your output. Default is FALSE.

See also

toupper, tolower, tocapital

Examples

tocamel("jonny appleseed")
#> [1] "JonnyAppleseed"
tocamel(c("jonny appleseed", "GraNDpa CrIPEs-mcgee"))
#> [1] "JonnyAppleseed" "GrandpaCripesMcgee"
# using a list object tocamel( list( c("THE", "DARK", "KNIGHT") , c("rises", "from the", "lazerus PIT") ) )
#> [,1] [,2] #> [1,] "The" "Rises" #> [2,] "Dark" "FromThe" #> [3,] "Knight" "LazerusPit"
# using a list object and collapseall tocamel( list( c("THE", "DARK", "KNIGHT") , c("rises", "from the", "lazerus PIT") ) , collapseall = TRUE )
#> [1] "TheDarkKnightRisesFromTheLazerusPit"