tidyName: Clean up a name

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/tidyName.R

Description

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

Usage

1
2
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

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

RADami documentation built on May 30, 2017, 8:23 a.m.