Description Usage Arguments Examples
Recodes a value or a vector of values.
1 | recodeValues(x, old, new, warn = TRUE)
|
x |
The vector whose values will be recoded. |
old |
the old value or a vector of old values (numeric/factor/string). |
new |
the new value or a vector of replacement values (1 to 1 recoding). |
warn |
A logical to print a message if any of the
old values are not actually present in |
1 2 3 4 5 6 | x <- LETTERS[1:5]
recodeValues(x, c("B", "D"), c("Beta", "Delta"))
# On numeric vectors
x <- c(1, 4, 5, 9)
recodeValues(x, old = c(1, 4, 5, 9), new = c(10, 40, 50, 90))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.