> -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
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
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:
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
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
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
6 matches
Mail list logo