checkOOB: Check OOB Function to check whether a given row is OOB, based...

View source: R/DOC_QA_QC_funs.R

checkOOBR Documentation

Check OOB Function to check whether a given row is OOB, based on comparisons to old data from the same lake/site/depthClass combo.

Description

Check OOB Function to check whether a given row is OOB, based on comparisons to old data from the same lake/site/depthClass combo.

Usage

checkOOB(oldData, newData, nPoints = 10, forceMultipleRows = F)

Arguments

oldData

A data frame containing previous DOC data: one row per sampleID (unless you set forceMultipleRows to T)

newData

The new data frame to check.

nPoints

Default 10. The threshold below which we won't compute mean/sd for comparison to new, incoming data. The idea is that fewer than e.g. 10 points isn't really enough data to get a meaningful estimate of the mean and standard deviation for DOC at a given site, and we don't want to assign a bunch of flags to new data based on shaky precedent.

forceMultipleRows

is F by default. If T, it allows more than one row per sampleID in oldData. This isn't typically how we do DOC quality control: we assume that old data represents either averaged values from multiple replicates, or singleton values.

Value

Data frame containing OOB classifications (TRUE/FALSE) in a column called 'OOB'.


MFEh2o/MFEUtilities documentation built on May 6, 2023, 1:33 p.m.