recode {hydrostats} | R Documentation |
recode
Description
Recodes values in a vector based on original and new values provided as two vectors.
Usage
recode(x, oldvalue, newvalue)
Arguments
x |
A vector with values to be replaced. |
oldvalue |
A vector of original values to be recoded. |
newvalue |
A vector of replacement values of the same length as oldvalue. |
Value
A vector of same length as input.
Author(s)
Nick Bond <n.bond@latrobe.edu.au>
Examples
x<-seq(1:10)
recode(x, c(1,5,10), c(-1,-5,-10))
[Package hydrostats version 0.2.9 Index]