] This vignette describes functions available for real-time quality control, i.e., the detection of data values outside some specification based on test procedures.

General structure and output

All real-time quality control functions accept a vector of data values, and may additionally require parameters such as

  • A set of “user thresholds” defining some expected behavior based on expert judgment.
  • A set of “sensor thresholds” defining some expected behavior based on sensor design or manufacturer guidelines.
  • Test-specific parameters.

All functions return an ordered factor tagging each data value as “pass” (1), “suspect” (2), or “fail” (3). Note that not all tests are capable of producing any of the three outcomes; for example, the “gap test” only returns “pass” or “fail” flags, and the “rate of change test” only returns “pass” or “suspect” flags.

Available real-time quality control functions

ODWGtools provides the following functions for real-time quality control:

Example Application

We use the cder package to download a sample of Belden’s Landing salinity data to demonstrate the real-time quality control functions.

library(cder)
bdl = cdec_query("BDL", 100L, "E", "2018-07-01", "2018-08-01")
library(ODWGtools)

bdl["gap"] = rtqc_gap(bdl$DateTime, "15 min", "is")
bdl["flat.test"] = rtqc_flat(bdl$Value, c(5, 10), 0.1)