Description Usage Arguments Value Examples
Replace values identical to value
with replacement
.
1 | replace_value(vector, value, replacement, warn = TRUE)
|
vector |
Vector to replace matches in. |
value |
Value to be replaced (must be a single element). |
replacement |
Value to replace matches with (must be a single element). |
warn |
Logical indicating whether to issue a warning message if no element is replaced. |
Vector
with all instances of value
replaced by
replacement
.
Note that factors will be releveled with the replacement values and levels no longer present in the factor may be lost.
1 2 | replace_value(c("Lions", "Tigers", "Antelopes"), value = "Antelopes",
replacement = "Bears")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.