Apply flatline QC flag
Arguments
- flag
character vector of current flag values (
"pass","suspect", or"fail").- vals
numeric vector of observed values, the same length as
flag.- dqo
two-row data frame of data quality objectives for the parameter being checked, containing one row where
Flag == "Fail"and one whereFlag == "Suspect". Optional numeric columnsFlatNandFlatDeltadefine the run-length and tolerance thresholds for each severity level. Either row may haveNAfor these columns, in which case that level of check is skipped.
Details
Uses utilASRflagrleflat to compute consecutive run lengths.
A run extends as long as the range (max minus min) of all values in the
run so far is strictly less than FlatDelta. An observation is
flagged "suspect" when its run length reaches FlatN (using
FlatDelta from the "Suspect" row), and "fail" when
its run length reaches FlatN (using FlatDelta from the
"Fail" row).
