Recode the value of a vector

Description

Recode the value of a vector or matrix.

Usage

1
recode(x, from, to)

Arguments

x

a vector or matrix

from

original value of x

to

new value of x

Value

recoded x

Author(s)

TszKin Julian Chan ctszkin@gmail.com

Examples

1
2
3
x=rep(1:5,each=2)
recode(x,from=1:5,to=5:1)
recode(x,from=1:5,to=11:15)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.