tidyName | R Documentation |
Deletes in a character vector all the characters provided in fixes
.
tidyName(x, fixes = c("_", ".", " ", "-", ">"),
case = c("lower", "upper", "nochange"))
x |
the vector in which to make replacements |
fixes |
all characters to be replaced |
case |
change case to upper, lower, or make no changes |
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.
A character vector of the same lenth as x
, but with characters replaced
I have used this function in many projects, and duplicates of it linger in a variety of places.
Andrew Hipp
nuttyName <- "Jimmy-Smith"
notNuttyName <- tidyName("Jimmy-Smith")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.