[R] selecting consecutive records over a threshold

Jamie Ledingham jamie.ledingham at newcastle.ac.uk
Wed Feb 27 18:00:07 CET 2008


Dear all,	
I am having trouble working out how I might do the following and would
appreciate any thoughts.
I am working with data concerning precipitation.  The data are in 2
columns in a data frame called "storm" in the following format:

HourCount - 1,2,3,4,5,6,7,8,...48
Amt - 0,0,0.3,3,4,8,10,15,12,6,4,3,0.2,0.2...

There are 48 hours worth of data.  I am trying to extract a storm.  My
storm is defined as a threshold - when the amount is greater than 2 for
2 hours the storm starts, and when the amount is less than 1 for two
hours the storm ends.
I can extract data above thresholds but it is obviously important to be
able to extract consecutive records to capture the whole storm.

Can anybody help?
Thanks
Jamie Ledingham
PhD Researcher
University of Newcastle Upon Tyne



More information about the R-help mailing list