to_camel | R Documentation |
Converts a vector of strings (e.g., column names) from snake_case to camelCase. (Specifically, lower camel case.)
to_camel(x, nums_to_camel = T)
x |
An atomic vector (character or coercible to character). |
nums_to_camel |
Should numbers be cameled as well? ('z_1_a' –> 'z1A') |
to_camel()
will return the input as a character vector with a warning
unless there is at least one underscore not in the first position somewhere
in the set of input strings.
E.g., to_camel(c('aaa', 'bbb', '_ccc'))
will return x
and a warning.
No dependencies.
A vector.
snakes <- c('rainbow_boa', 'blue_racer', 'dragon_snake',
'a_set_of_5_garter_snakes', 'a_larger_set_of_6_kingsnakes')
to_camel(snakes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.