[R] grouping elements of a data frame

Nuri Alpay Temiz alpaytemiz at outlook.com
Tue Jan 15 18:10:49 CET 2013


Hi everyone,

I have a question on selecting and grouping elements of a data frame. For example:

A.df<- [ a c 0.9
             b  x 0.8
             b z 0.5
             c y 0.9
             c x 0.7
             c z 0.6]


I want to create a list of a data frame that gives me the unique values of column 1 of A.df so that i can create intersects. That is:

B[a]<- [ c 0.9]

B[b]<- [ x 0.8
             z 0.5]

B[c]<- [ y 0.9
             x 0.7
             z 0.6]


B[c] n B[b] <- c(x,z)


How can I accomplish this?

Thanks,
Al
                     
             


More information about the R-help mailing list