camel_to_snake: Convert camel case words to snake case words

View source: R/strings.R

camel_to_snakeR Documentation

Convert camel case words to snake case words

Description

camel_to_snake is a function that splits a word by capital letters, converts all letters to lower case and bind the splitted words together by an underscore, e.g., SecurityId becomes security_id. It is primarily used to fix the column names in the raw data downloaded from Børsprosjektet.

Usage

camel_to_snake(x)

Arguments

x

Character vector of one or more elements.

Details

Used in scripts: Robust function: TRUE

Value

Character vector of camel case words.

Examples

## Not run: 
camel_to_snake("SecurityID")

camel_to_snake("SecId", "FooBar")

## End(Not run)

AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.