tidai: Replace a vector by named vector

tidaiR Documentation

Replace a vector by named vector

Description

Replace a vector by named vector

Usage

tidai(x, y, fac = FALSE, keep_origin = FALSE)

Arguments

x

a vector need to be replaced

y

named vector

fac

consider the factor?

keep_origin

keep_origin?

Value

vector

Examples

tidai(c("a", "a", "b", "d"), c("a" = "red", b = "blue"))
tidai(c("a", "a", "b", "c"), c("red", "blue"))
tidai(c("A" = "a", "B" = "b"), c("a" = "red", b = "blue"))
tidai(factor(c("A" = "a", "B" = "b", "C" = "c")), c("a" = "red", b = "blue", c = "green"))

pcutils documentation built on June 26, 2024, 1:06 a.m.