[R] Fwd: conditionally merging adjacent rows in a data frame

2009-12-09 Thread Marek Janad
I've also made some comparisons and taking into account execution time, sqldf wins. SummaryBy is better then aggregate in some specific situations I met in practice. I present this situation below. It assumes, that there are at least two groups with high number of levels. n<-10; grp1<-sample(1

[R] Fwd: conditionally merging adjacent rows in a data frame

2009-12-08 Thread Gray Calhoun
I think I forgot to send the original to the mailing list, so I'm forwarding it (see below). Sorry about that (and sorry if I did remember and this is a duplicate). After a few more minutes of thought, I realized that you should probably make sure that rt, tid, and mood are also the same in conse