[R] DF grouping

karthicklakshman karthick.lakshman at gmail.com
Mon Nov 26 18:19:22 CET 2012


Hello Petr Savicky, hello all,

I have a situation similar to the previous one,
I need to group a data.frame in a specific way,

col1 col2   score
2873  3192   319
4268  4451   183
5389  5534   145
6622 10622  4000
12631 17853  5222
20408 20615   207
21595 21838   243
23121 23139    18

the out put should be like,

[1] 
2873  3192   4268  4451   5389  5534  6622 10622 
[2] 
10622  12631
[3] 
17853 20408 20615  21595 21838   23121 23139 

Basically the split should be based on the DF$score > 500, and all the col1
and col2 values should be aggregated. but  DF[i, "col2"] != DF[i+1, "col1"]

Your inputs will be very helpful
Thank you
Karthick




--
View this message in context: http://r.789695.n4.nabble.com/DF-grouping-tp4381310p4650865.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list