[R] grouping modalities

Jorge Manuel de Almeida Magalhães jmagalhaes at oninetspeed.pt
Mon Oct 15 21:03:27 CEST 2007


> 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



More information about the R-help mailing list