recode {Jmisc} | R Documentation |
Recode the value of a vector
Description
Recode the value of a vector
or matrix
.
Usage
recode(x, from, to)
Arguments
x |
a |
from |
original value of |
to |
new value of |
Value
recoded x
Author(s)
TszKin Julian Chan ctszkin@gmail.com
Examples
x=rep(1:5,each=2)
recode(x,from=1:5,to=5:1)
recode(x,from=1:5,to=11:15)
[Package Jmisc version 0.3.1.1 Index]