This function checks if the following parameters are within range, have a reasonable rate of change, do not flat line or have sensor drift: temperature, dissolved_oxygen, pH, conductivity, turbidity. The parameters should be spelled as listed.

qc_water_quality(
  data,
  temp_range = c(-1, 35),
  do_range = c(0, 20),
  ph_range = c(5, 10),
  cond_range = c(0, 3000),
  turb_range = c(0, 1000),
  drift_window = 7
)

Arguments

data

Data frame with columns: datetime, parameter, value, site_id

temp_range

Numeric vector of min/max acceptable temperature (°C)

do_range

Numeric vector of min/max acceptable DO (mg/L)

ph_range

Numeric vector of min/max acceptable pH

cond_range

Numeric vector of min/max acceptable conductivity (μS/cm)

turb_range

Numeric vector of min/max acceptable turbidity (NTU)

drift_window

Integer, number of days to check for drift

Value

List with flags, summary, and plots