map | R Documentation |
A mnemonic for to[match(x, from)]
.
Compare with the more elaborate tr
or tran
.
map(from, to, x, ...)
from |
vector of values to be matched against |
to |
vector from which selected values are returned |
x |
vector of values to be matched |
tran
tr
x.from <- c('A',"FromNA",'Z','B',"N")
x.to <- factor(c('a',NA,'z','b',NA),levels=c('z','a','b',NA))
x <- c("Z","B",NA,"N","M")
map(x.from, x.to, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.