fix_name_labels: Fix name labels

View source: R/fix_name_labels.R

fix_name_labelsR Documentation

Fix name labels

Description

Fixes if a factor list does not have named levels or has special characters in the names

Usage

fix_name_labels(x, pattern = NA, replacement = ".")

Arguments

x

the vector or list to fix

pattern

regex pattern to replace; defaults to non-word characters and the value of faux_options("sep") (default = _)

replacement

the character to replace; defaults to . (or _ if faux_options("sep") == ".")

Value

a named list with fixed names

Examples

source <- list("full.stop", " space ", "under_score", "plus+", "dash-", "tab\t", "line\nbreak")
fix_name_labels(source)


faux documentation built on April 20, 2023, 9:13 a.m.