View source: R/transforms_time.R
replace_values | R Documentation |
Replace values in a vector with supplied values
replace_values(x, ..., .not_found = NULL)
x |
The vector in which to replace values |
... |
Name and value pairs, where name is what is replaced and value is what it is replaced with. |
.not_found |
Value to use for unmatched values. If not provided, unmatched values are unchanged. |
A vector with the replaced values. An attempt is made to convert the return type to numeric, if possible.
replace_values(c("a","b","c"),a=1,b=2)
replace_values(c("a","b","c"),a=1,b=2, .not_found = NA)
replace_values(c("a","b","c"),a=1,b=2, .not_found = "")
replace_values(c("a","b","c"),a=1,b="hello", .not_found = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.