replace_values: Replace values in a vector

View source: R/utils.R

replace_valuesR Documentation

Replace values in a vector

Description

Replace the values in a vector

Usage

replace_values(x, from, to, must_have=TRUE)

Arguments

x

vector

from

values to be changed

to

what values need to be changed to

must_have

logical. Give an error if a value in from is not in x

Value

vector

Examples

v <- LETTERS[1:5]
replace_values(v, c("A", "B", "C"), c("first", "abc", "third"))

reagro/carobiner documentation built on Dec. 4, 2024, 3:21 p.m.