Displaying 1 result from an estimated 1 matches for "rhrevdis1".
Did you mean:
hrevdis1
2008 May 19
2
recoding data with loops
...)])
mdf
# Then, I'd like to recode the variables that begin with the letter "H".
# I've tried many variations of the following, but to no avail:
reverse_list <- c("HEQUAL", "HREVDIS1", "HREVDIS2")
reversed_list <- c("RHEQUAL", "RHREVDIS1", "RHREVDIS2")
for(i in 1:length(reverse_list))
{mdf[ ,e_reversed_list][[i]] <- recode(mdf[ ,e_reverse_list][[i]],
'5:99=NA; 1=4; 2=3; 3=2; 4=1; ', as.factor.result=FALSE)
# I'm sure I have many deep misunderstandings about the R language, but
# if I can get this muc...