Thank you all very much for your helpful comments and showing where I went wrong. After so many trials, the code below seems to work: incorp <- with(data7.13.11, ifelse(groupinc %in% c(5), 'cons', ifelse(groupinc %in% c(-3,-2) & indinc < 9, 'ethnat', ifelse(groupinc %in% c(1,2,3,4) & indinc > 8, 'libmul', ifelse(groupinc %in% c(-2,-1) & indinc > 8, 'civic', NA)))))
Let me know if it's just an illusion on my part -- View this message in context: http://r.789695.n4.nabble.com/conditional-coding-question-tp4648801p4648915.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.