I want to recode some numeric values into different numeric values and have had a go using the following code:
survey$KY27PHYc <- revalue(survey$KY27PHY1, c(5=3, 4=2,3=2,2=1,1=1))
I get the following error:
## Error: unexpected '=' in "survey$KY27PHYc <- revalue(survey$KY27PHY1, c(5="
Where am I going wrong?
plyrfor this? You probably should mention it - David Arenburgsearch()or ?revalue to figure that out. (I briefly tagged it dplyr on the assumption it was.) - smcimergewith a data frame containing both old and new values:merge(survey, data.frame(KY27PHY1 = c(5,4,3,5,1), KY27PHY1_new = c(3,2,2,1,1))). - Paul Rougieux