Description Usage Arguments Value Examples
Clean names so that quotes (or backquotes) will not be necessary when subsetting the object.
The names input will be cleaned by replacing all occurrences of:
$
with "Dollar"
(or "Dol"
, if short == TRUE
)
%
with "Percent"
(or "Perc"
, if short == TRUE
)
Any other non-word character (i.e. character not in [a-z, A-Z, 0-9, _]
) with "_"
1 | clean_names(vec, short = FALSE)
|
vec |
A character vector of names to clean. |
short |
Whether to shorten certain cleaned name replacements (logical scalar). |
A character vector of cleaned names.
1 2 | clean_names(c("apple", "banana", "ab.cd", "ef_gh", "ij/kl", "a_%_b", "a_$_b", "mn__op"))
clean_names(c("a_%_b", "a_$_b"), short = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.