standardizeNames: Standardize a character vector to standard syntax, defaulting...

View source: R/standardize_names.R

standardizeNamesR Documentation

Standardize a character vector to standard syntax, defaulting to camelCase

Description

A synonym for standardize_names, but with case set to "camelCase" by default. Standardize all elements of a character vector to the same syntax. All letters are converted to lowercase, special characters are converted to underscores (snake_case) or removed (camelCase), and multiple and trailing (but not leading) special characters are removed. By default, elements are deduplicated by appending "_1" (snake_case) or "1" (camelCase) and so on.

Usage

standardizeNames(x, dedup = TRUE, case = "camelCase")

Arguments

x

character vector with elements to be standardized

dedup

logical, whether to deduplicate the vector elements. If TRUE, elements that are identical after standardization are deduplicated by appending "_1", "_2", etc. Defaults to TRUE.

case

character, whether to standardize to "camelCase" or "snake_case" case. Defaults to "camelCase". Partial matches are okay.

Value

a character vector of the same length as x


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.