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.
An observation is flagged "suspect" when its run length (computed
with FlatDelta from the "Suspect" row) reaches FlatN,
and "fail" when its run length (computed with FlatDelta from
the "Fail" row) reaches FlatN.