snakeToCamel: Transform a string from snake_case to camelCase.

View source: R/snakeToCamel.R

snakeToCamelR Documentation

Transform a string from snake_case to camelCase.

Description

Given a string like "mean_attitude", the function returns "meanAttitude". But for any given string segment involving an underscore character, the the segment will be transformed only if the character before the underscore is a lower-case letter. For example, "MEAN_attitude" won't be transformed. Nor will "PID3_early."

Usage

snakeToCamel(x)

Arguments

x

A string.

See Also

\linkInt

spaceToCamel

Examples

snakeToCamel("party_ID")      # [1] "partyID"
snakeToCamel("hours_9_to_5")  # [1] "hours9_to_5" 


jbullock35/Bullock documentation built on April 1, 2022, 6:21 p.m.