Learn R Programming

RADami (version 1.1-2)

tidyName:

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

Value

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

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.

Examples

Run this code
nuttyName <- "Jimmy-Smith"
notNuttyName <- tidyName("Jimmy-Smith")

Run the code above in your browser using DataLab