Description Usage Arguments Value Examples
This function replaces character values with new character values, which is useful when performing rename operations when values are held in character vectors.
1 | rename.values(x, ..., defaultValue = x, warn_missing = TRUE)
|
x |
Vector of values to replace |
... |
Key/value pairs in the form |
defaultValue |
A vector of values to use as the default should the value not
be found in |
warn_missing |
Print a message if any old names are not actually present in x |
A vector with values replaced
1 2 3 4 | x <- c("fish", "fish", "fish", "whistle")
rename.values(x, fish="newfish")
rename.values(x, whistle="newwhistle")
rename.values(x, fish="newfish", defaultValue="not a fish")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.