powered by
data.frame
recode(vars, old, new, data = .data, ...)
df = data.frame(id=1:20, x=rnorm(20, mean=2, sd=.5), z=sample(5, 20, rep=TRUE) ) use(df) # recoding x to missing value: recode(z, old = c(1,2,3,4,5), new = c(5,4,3,2,1), data=df)
Run the code above in your browser using DataLab