Re: [R] Ordering numbers

2009-12-02 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Lisa > Sent: Wednesday, December 02, 2009 12:30 PM > To: r-help@r-project.org > Subject: [R] Ordering numbers > > > Hello all, > > I have a se

Re: [R] Ordering numbers

2009-12-02 Thread Peter Dalgaard
Greg Snow wrote: Here is one way: id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4, + 4, 4, 5, 5) id [1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5 tmp <- rle(id) tmp Run Length Encoding lengths: int [1:12] 2 3 1 4 1 3 2 3 1 1 ... values : num [1:12] 1

Re: [R] Ordering numbers

2009-12-02 Thread Greg Snow
ginal Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Senthil Kumar M > Sent: Wednesday, December 02, 2009 1:36 PM > To: Lisa > Cc: r-help@r-project.org > Subject: Re: [R] Ordering numbers > > On Wed, Dec 2, 2009 at 3:

Re: [R] Ordering numbers

2009-12-02 Thread Greg Snow
l Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Lisa > Sent: Wednesday, December 02, 2009 1:30 PM > To: r-help@r-project.org > Subject: [R] Ordering numbers > > > Hello all, > > I have a set of numbers that looks

Re: [R] Ordering numbers

2009-12-02 Thread Senthil Kumar M
On Wed, Dec 2, 2009 at 3:30 PM, Lisa wrote: > > Hello all, > > I have a set of numbers that looks like this: > >> id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4, >> 4, 4, 5, 5) >> id > [1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5 > > Please ignore the bold num

[R] Ordering numbers

2009-12-02 Thread Lisa
Hello all, I have a set of numbers that looks like this: > id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, 3, 4, > 4, 4, 5, 5) > id [1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5 Please ignore the bold numbers, I just want to make my problem clear. I am going to or