:15 PM
Subject: Re: [R] Count continuous dates
Hi Tim,
Thanks for providing nice sample data! It made this super easy :)
## use diff() to find the differences
## use rle() to find the run lengths
## use max to find the highest one
max(rle(as.vector(diff(x)))$lengths)
Cheers,
Josh
On Wed, Nov
Hi Tim,
Thanks for providing nice sample data! It made this super easy :)
## use diff() to find the differences
## use rle() to find the run lengths
## use max to find the highest one
max(rle(as.vector(diff(x)))$lengths)
Cheers,
Josh
On Wed, Nov 10, 2010 at 10:07 PM, Tim Clark wrote:
> Dear
Dear List,
I have a series of dates and I am needing to know the greatest length of
continuous dates - i.e. the number of dates before a break in the series. For
example, below there are three continuous series of dates with lengths 4, 6,
and
8. How can I count the number of continuous dates
3 matches
Mail list logo