qaqc_stic_data {STICr}R Documentation

qaqc_stic_data

Description

This function provides multiple options for QAQC flagging of processed and classified STIC data frames, such as those generated by the classify_wetdry function. Users can select which operations are to be performed, and a single new QAQC column is created with all flags concatenated. QAQC options currently include: (1) correction and flagging of negative SPC values resulting from the calibration process, i.e., changing the negative values to 0 and flagging this (2) inspecting the wetdry classification time series for potential deviation anomalies based on user-defined windows

Usage

qaqc_stic_data(
  stic_data,
  spc_neg_correction = TRUE,
  inspect_deviation = TRUE,
  deviation_size = NULL,
  window_size = NULL
)

Arguments

stic_data

A data frame with classified STIC data, such as that produced by classify_wetdry.

spc_neg_correction

a logical argument indicating whether the user would like to correct negative SPC values resulting from the calibration process to 0. The character code associated with this correction is "C".

inspect_deviation

a logical argument indicating whether the user would like to identify deviation anomalies, in which a series of wet or dry readings less than or equal to 'deviation_size' in length is surrounded on both sides by 'window_size' or more observations of its opposite. This operation is meant to identify potentially suspect binary wet/dry data points for further examination. The character code associated with this operation is "D".

deviation_size

a numeric argument specifying the maximum size (i.e., number of observations) of a clustered group of points that can be flagged as an deviation

window_size

a numeric argument specifying the minimum size (i.e., number of observations) that the deviation must be surrounded by in order to be flagged

Value

The same data frame as input, but with new QAQC columns or a single, concatenated QAQC column. The QAQC output Can include: "C", meaning the calibrated SpC value was negative from 'spc_neg_correction'; "D", meaning the point was identified as a deviation or deviation based on a moving window from 'inspect_deviation'; or "O", meaning the calibrated SpC was outside the standard range based on the function apply_calibration.

Examples

qaqc_df <-
  qaqc_stic_data(classified_df,
    spc_neg_correction = TRUE,
    inspect_deviation = TRUE,
    deviation_size = 4, window_size = 96
  )
head(qaqc_df)

[Package STICr version 1.1 Index]