replace_value: Replace values identical to 'value' with 'replacement'.

Description Usage Arguments Value Examples

View source: R/replace.R

Description

Replace values identical to value with replacement.

Usage

1
replace_value(vector, value, replacement, warn = TRUE)

Arguments

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.

Value

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.

Examples

1
2
replace_value(c("Lions", "Tigers", "Antelopes"), value = "Antelopes",
   replacement = "Bears")

seaaan/easieR documentation built on May 29, 2019, 4:23 p.m.