> Dear Sirs: > > Is there a way to group multiple responses in variables sets. SPSS > have this feature: this is possible to group a set of variables by > their common categories. I would like to do the same in R.
Example: my.df = data.frame(var1=c(1,2,2,1,2,2,1,2), var2=c(2,2,1,1,2,2,1,1), var3=c(1,2,2,1,1,1,1,2), var4=c(1,1,1,1,2,1,2,1)) I'm looking for a way compute set1 and set2? set1 = c(5,4) % (var1, var2) modality = 2 set2=c(3,2) % (var3, var4) modality = 2 Thanks a lot jorge ______________________________________________ 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.