[R] selecting consecutive records over a threshold

From: Jamie Ledingham <jamie.ledingham_at_newcastle.ac.uk>
Date: Wed, 27 Feb 2008 17:00:07 +0000


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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 27 Feb 2008 - 17:10:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Feb 2008 - 23:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive