spaceToCamel: Transform a string that has spaces to camelCase.

View source: R/spaceToCamel.R

spaceToCamelR Documentation

Transform a string that has spaces to camelCase.

Description

Given a string like "mean attitude", the function returns "meanAttitude". But if the character just before the space is uppercase, the space will be replaced by an underscore (_): "TV news" will become "TV_news".

Usage

spaceToCamel(x)

Arguments

x

A string.

See Also

\linkInt

snakeToCamel

Examples

spaceToCamel("colleges and universities")  # [1] "collegesAndUniversities"
spaceToCamel("TV news")                    # [1] "TV_news" 
spaceToCamel("TV News")                    # [1] "TV_News"


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