powered by
Recodes values in a vector based on original and new values provided as two vectors.
recode(x, oldvalue, newvalue)
A vector with values to be replaced.
A vector of original values to be recoded.
A vector of replacement values of the same length as oldvalue.
A vector of same length as input.
# NOT RUN { x<-seq(1:10) recode(x, c(1,5,10), c(-1,-5,-10)) # }
Run the code above in your browser using DataLab