Recoding variables in R, seems to be my biggest headache. What functions, packages, processes do you use to ensure the best result?
I\'ve found very few useful exam
I found mapvalues from plyr package very handy. Package also contains function revalue which is similar to car:::recode.
The following example will "recode"
> mapvalues(letters, from = c("r", "o", "m", "a", "n"), to = c("R", "O", "M", "A", "N"))
[1] "A" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "M" "N" "O" "p" "q" "R" "s" "t" "u" "v" "w" "x" "y" "z"