r-help@r-project.org
> Subject: [R] Finding and manipulation clusters of numbers in a sequence of
> numbers
>
> Hi,
>
> I have the following sequence:
> in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0,
On Mon, Jul 16, 2012 at 12:17 PM, mdvaan wrote:
> Hi,
>
> I have the following sequence:
> in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2)
>
> >From this sequence I would like to get to the following sequence:
> o
Hi,
I have the following sequence:
in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2)
>From this sequence I would like to get to the following sequence:
out <- c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1
3 matches
Mail list logo