Apply multiple quality control tests to current data
adcp_test_all.RdThis function has been deprecated. The rolling_sd and spike tests are not applied to the current data prior to publication.
Usage
adcp_test_all(
dat,
qc_tests = NULL,
county = NULL,
current_grossrange_table = NULL,
current_rolling_sd_table = NULL,
current_spike_table = NULL,
period_hours = 12,
max_interval_hours = 2,
align_window = "center",
keep_sd_cols = FALSE,
keep_spike_cols = FALSE
)Arguments
- dat
Data frame of wave data in a wide format.
- qc_tests
Character vector of quality control tests to apply to
dat. Defaults to all available tests:qc_tests = c("grossrange", "rolling_sd", "spike").- county
Character string indicating the county from which
datwas collected. Used to filter the defaultcurrent_grossrange_table.- current_grossrange_table
Data frame with at least 5 columns:
variable: entries must match the names of the variables being tested indat;gr_min: minimum acceptable value;gr_max: maximum accepted value ;user_min: minimum reasonable value;user_max: maximum reasonable value.- current_rolling_sd_table
Data frame with at least two columns:
variable: must match the names of the variables being tested indat.rolling_sd_max: maximum accepted value for the rolling standard deviation.Default values are used if
rolling_sd_table = NULL. To see the defaultrolling_sd_table, typesubset(current_thresholds, qc_test == "rolling_sd")in the console.- current_spike_table
Data frame with at least 3 columns:
variable: should match the names of the variables being tested indat.spike_low: maximum acceptable spike value to "Pass", andspike_high: maximum acceptable value to be flagged "Suspect/Of Interest".Default values are used if
current_spike_table = NULL. To see the defaultcurrent_spike_table, typesubset(current_thresholds, qc_test == "spike")in the console.- period_hours
Length of a full cycle in hours. Default assumes a tidal cycle of
period_hours = 12.- max_interval_hours
Maximum accepted interval between two observations. If the interval between two observations is greater than this value, the rolling standard deviation will be set to
NA. This is important because for large intervals, the number of observations inperiod_hourswill be small. For example, if samples are collected every 6 hours, only 2 observations would be used to calculateroll_sd.- align_window
Alignment for the window used to calculate the rolling standard deviation. Passed to
zoo::rollapply(). Default isalign_window = "center". Other options are"right"(backward window) and"left"(forward window).- keep_sd_cols
Logical value. If
TRUE, the columns used to produce the rolling standard deviation (int_sample,n_sample, andsd_roll) are returned indat. Default isFALSE.- keep_spike_cols
Logical value. If
TRUE, the columns used to produce the spike value are returned indat. Default isFALSE.