tidyName: Clean up a name

View source: R/tidyName.R

tidyNameR Documentation

Clean up a name

Description

Deletes in a character vector all the characters provided in fixes.

Usage

tidyName(x, fixes = c("_", ".", " ", "-", ">"),
            case = c("lower", "upper", "nochange"))

Arguments

x

the vector in which to make replacements

fixes

all characters to be replaced

case

change case to upper, lower, or make no changes

Details

This function currently uses no regular expressions or wildcards and is made deliberately very thorough, tedious even, as it cycles through all characters in turn.

Value

A character vector of the same lenth as x, but with characters replaced

Note

I have used this function in many projects, and duplicates of it linger in a variety of places.

Author(s)

Andrew Hipp

Examples

nuttyName <- "Jimmy-Smith"
notNuttyName <- tidyName("Jimmy-Smith")

andrew-hipp/RADami documentation built on Nov. 9, 2023, 5:40 p.m.