Dear all,
I have  a data series (might be vector or matrix) which is composed only from zeros and ones like the following example

0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0

I want to be able to return back the length of concecutive zeros and the length of concecutive ones.

For that I want to have something like that returned:


zeros= [3 1 2 3];
ones=[2 1 4];

How I can do that simply in R?

I would like to thank you in advance for your help


B.R
Alex

	[[alternative HTML version deleted]]

