Re: [R] how to find maximum for multivariable data

2009-09-13 Thread caroline choong
Many thanks, truly a simple and elegant solution! Caroline On Sun, Sep 13, 2009 at 12:08 AM, David Winsemius wrote: > > On Sep 12, 2009, at 11:36 AM, caroline choong wrote: > >> Dear all, >> I have a data set as follows: >> >>        ID               cycle.number      cycle.result >> 1     2525

Re: [R] how to find maximum for multivariable data

2009-09-12 Thread David Winsemius
On Sep 12, 2009, at 11:36 AM, caroline choong wrote: Dear all, I have a data set as follows: ID cycle.number cycle.result 1 2525 1 38 2 2525 2 38 3 2525 3

Re: [R] how to find maximum for multivariable data

2009-09-12 Thread Henrique Dallazuanna
Try this: If cycle.number is ordered: do.call(rbind, lapply(split(x, x$ID), tail, 1)) On Sat, Sep 12, 2009 at 12:36 PM, caroline choong wrote: > Dear all, > I have a data set as follows: > > ID cycle.number cycle.result > 1 2525 1

[R] how to find maximum for multivariable data

2009-09-12 Thread caroline choong
Dear all, I have a data set as follows: ID cycle.number cycle.result 1 2525 1 38 2 2525 2 38 3 2525 3 25 4 2525 4