Description Usage Arguments Value Author(s) Examples
The mapping is represented by a data.frame: 1st column is the domain, 2st column is the range.
1 | changeByMap(old_vector, mapping_dat, reverse = FALSE)
|
old_vector |
vector of any type. |
mapping_dat |
data.frame, first column must be the same type as the |
reverse |
logical. Reverse domain and range if set to TRUE |
The new vector (mapped from the old one).
Kaiyin Zhong, Fan Liu
1 2 3 4 5 6 7 | ## Not run:
names_dat = data.frame(c("a", "b", "c"), c("d", "e", "f"), stringsAsFactors=FALSE)
changeByMap(c("a", "a", "b"), names_dat) == c("d", "d", "e")
x = changeByMap(c(NA, "a", "b"), names_dat)
is.na(x[1])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.