Description Usage Arguments tocamel tocapital See Also Examples
Family of functions to change the lettercase of strings to camel or capital case.
1 2 3 |
x |
A character vector, or list object of character vectors. |
collapseall |
A logical scalar. Indicate whether or not you want a single character vector as your output. Default is |
fix_mc |
A logical scalar. Indicate if |
Convert character vectors to camelcase
(ie PaulJames)
Takes a character vector, or list object of character vectors and converts the case to camelcase. 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.
Convert character vectors to capitalcase
(ie Paul James)
Takes a character vector, or list object of character vectors and converts the case to capitalcase (AKA, title 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | tocamel("jonny appleseed")
tocamel(c("jonny appleseed", "GraNDpa CrIPEs-mcgee"))
# using a list object
tocamel(
list(
c("THE", "DARK", "KNIGHT")
, c("rises", "from the", "lazerus PIT")
)
)
# using a list object and collapseall
tocamel(
list(
c("THE", "DARK", "KNIGHT")
, c("rises", "from the", "lazerus PIT")
)
, collapseall = TRUE
)
tocapital("jonny appleseed")
# using a list object
tocapital(
list(
c("THE", "DARK", "KNIGHT")
, c("rises", "from the", "lazerus PIT")
)
)
# using a list object and collapseall
tocapital(
list(
c("THE", "DARK", "KNIGHT")
, c("rises", "from the", "lazerus PIT")
)
, collapseall = TRUE
)
# examples of not fixing Mc* names (the default) vs fixing them
tocapital(c("jonny appleseed", "GraNDpa CrIPEs-mcgee"))
tocapital(
c("jonny appleseed", "GraNDpa CrIPEs-mcgee")
, fix_mc = TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.