Recoding is a common practice for survey data, but the most obvious routes take more time than they should.
The fastest code that accomplishes the same task with the pr
Try this:
m <- as.matrix(dat) dat <- data.frame( matrix( re.codes[m], nrow = nrow(m)))