massbays-tech / MassWateR

R package for working with Massachusetts surface water quality data
https://massbays-tech.github.io/MassWateR
Creative Commons Zero v1.0 Universal
11 stars 3 forks source link

warning for incomplete coverage of value range in DQO accuracy table #58

Closed fawda123 closed 1 year ago

fawda123 commented 1 year ago

The value range column indicates a range of measurements within which DQOs apply for each parameter. It was assumed that users would supply value ranges that cover all possible outcomes for a parameter. This may not be true. MassWateR should return a warning on import and QC report generation (i.e., checkMWRacc() and qcMWRreview() or lesser functions) indicating incomplete value ranges and the associated parameter(s). This issue should be addressed after #57.

fawda123 commented 1 year ago

Added utilMWRvaluerange() which checks for na, gaps, and overlap. checkMWRacc() returns a warning for gaps and errors for na and overlap.

fawda123 commented 1 year ago

Warning now returned with tabMWRacc() (from qcMWRacc()), also returned when running qcMWRreview(), if gap is presentin Value Range column of the DQO accuracy file.

fawda123 commented 1 year ago

@ben-wetherill this should have the correct behavior now, warnings are returned on import of the DQO accuracy file and on report generation if the DQO accuracy file has gaps in the Value Range column. Also note that readMWRacc() now also checks for overlap in value ranges (e.g., >4, <5), which will now return an error on import.

ben-wetherill commented 1 year ago

This looks good.