value_replacer: Replace arbitrary values in your data

Description Arguments Value Examples

Description

Replace arbitrary values in your data

Arguments

x

an atomic vector. The column to transform.

values_map

a list. If named, the names get replaced w/ the values. Otherwise, the list elements are lists of 2 elements, the first of which are the values to be replaced and the second the replacement value.

Value

the replaced column

Examples

1
2
3
4
5
6
## Not run: 
# replace A, B, D with 1 and NA with 0.
value_replacer()$run(c("A", "B", NA, "D"), list(list(c("A","B","D"), 1), list(NA, 0)))
value_replacer()$run(c("A", "B", NA, "D"), list(A = 1, B = 1, D = 1, list(NA, 0)))

## End(Not run)

syberia/syberiaMungebits2 documentation built on May 30, 2019, 10:42 p.m.