alphaOnly | R Documentation |
From a text string, keep ASCII letters, numbers, as well as "'", " ", "_" "(", ")", "-", and "+". For maximum compatability with the cross-platform file-naming standard. Obliterates all characters that migth be mistaken for shell symbols, like "^", "$", "@" and so forth.
alphaOnly(x, also)
x |
text string, or vector of strings (each of which is processed separately) |
also |
A named vector of other symbols that the user wants to remove, along with replacements. For example, c(" " = "_", "-" = "", "+" = "") to replace space with underscore and minus and plus signs with nothing. |
Removes trailing spaces.
This version allows internal spaces in the string, by default. The also argument can be used to eliminate spaces or other hated symbols.
cleaned text string
Paul Johnson <pauljohn@ku.edu>
x <- c("[]kansas(city) Missouri", "percent%slash/",
"\back{squiggle}_under(paren)", "*star-minus+plus")
alphaOnly(x)
alphaOnly(x, also = c(" " = "_", "+" = "_"))
alphaOnly(x, also = c("(" = "[", ")" = "]"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.