powered by
recode(vec, original, modified)
x <- c(0,1,2,3,4,0,1,2,3,4) y <- c(0,1,2,3,4) z <- c(1,2,3,4,5) recode(x,y,z) ##returns c(1,2,3,4,5,1,2,3,4,5)
Run the code above in your browser using DataLab