Re: [R] count length of continues elements in a vector

2011-06-07 Thread Marc Schwartz
On Jun 7, 2011, at 9:25 AM, davetracz wrote: > I am performing a precipitation analysis. data is in the form of daily > precipitation amounts, e.g. > > x<- c(4,5,3,0,0,0,2,4,6,4,0,0,0,2,2,0,3,4,1,0,...) > > I would like to find the length of the "storm", length of storm would be > defined as the

[R] count length of continues elements in a vector

2011-06-07 Thread davetracz
I am performing a precipitation analysis. data is in the form of daily precipitation amounts, e.g. x<- c(4,5,3,0,0,0,2,4,6,4,0,0,0,2,2,0,3,4,1,0,...) I would like to find the length of the "storm", length of storm would be defined as the number of days with continues precipitation. in this case t