tidai {pcutils}R 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"))

[Package pcutils version 0.2.6 Index]