clean_names: Clean names

View source: R/utils_strings.R

clean_namesR Documentation

Clean names

Description

Clean character vector by replacing all symbols and sequences of symbols with single underscores, ensuring no name begins or ends with a symbol

Usage

clean_names(x, prefix_digits = "V_")

Arguments

x

Character vector.

prefix_digits

Character: prefix to add to names beginning with a digit. Set to NA to skip.

Value

Character vector.

Author(s)

EDG

Examples

## Not run: 
x <- c("Patient ID", "_Date-of-Birth", "SBP (mmHg)")
x
clean_names(x)

## End(Not run)

egenn/rtemis documentation built on June 14, 2025, 11:54 p.m.