[R] Filtering data

Matt Pocernich mpocerni at math.cudenver.edu
Wed Nov 7 04:39:54 CET 2001


I am having difficulty filtering data.  I am working with flow data
collected at a stream gage.  For each record, I have a date and flow
value.  I have filtered this data to only include days when flow values
exceed a given threshold.

Here is my problem.  Within this subset of data, I often have several
consecutive days above the threshold.  From this group of days, I wish to
select the record (both date and flow) containing the maximum flow.  If an
exceedance is isolated ( the preceeding and succeeding day is below the
threshold) I also wish to select that record.

For example from the data set

Day 	Flow

1	10
4 	13
5	20
6	15
9	13

I would like the 1st, 3rd and 5th record filered.

Any ideas on how I would write such and algorithm would be appreciated.


Matt Pocernich

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list