value_replacer_fn: Replace arbitrary values in your data

Description Usage Arguments Value Examples

View source: R/value_replacer.r

Description

Replace arbitrary values in your data

Usage

1
value_replacer_fn(x, values_map)

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(c("A", "B", NA, "D"), list(list(c("A","B","D"), 1), list(NA, 0)))
value_replacer(c("A", "B", NA, "D"), list(A = 1, B = 1, D = 1, list(NA, 0)))

## End(Not run)

robertzk/syberiaMungebits documentation built on May 25, 2017, 6:40 a.m.