qcMWRcom {MassWateR} | R Documentation |
Run quality control completeness checks for water quality monitoring results
Description
Run quality control completeness checks for water quality monitoring results
Usage
qcMWRcom(res = NULL, frecom = NULL, fset = NULL, runchk = TRUE, warn = TRUE)
Arguments
res |
character string of path to the results file or |
frecom |
character string of path to the data quality objectives file for frequency and completeness or |
fset |
optional list of inputs with elements named |
runchk |
logical to run data checks with |
warn |
logical to return warnings to the console (default) |
Details
The function can be used with inputs as paths to the relevant files or as data frames returned by readMWRresults
and readMWRfrecom
. For the former, the full suite of data checks can be evaluated with runkchk = T
(default) or suppressed with runchk = F
. In the latter case, downstream analyses may not work if data are formatted incorrectly. For convenience, a named list with the input arguments as paths or data frames can be passed to the fset
argument instead. See the help file for utilMWRinput
.
Note that frequency is only evaluated on parameters in the Parameter
column in the data quality objectives frequency and completeness file. A warning is returned if there are parameters in Parameter
in the frequency and completeness file that are not in Characteristic Name
in the results file.
Similarly, parameters in the results file in the Characteristic Name
column that are not found in the data quality objectives frequency and completeness file are not evaluated. A warning is returned if there are parameters in Characteristic Name
in the results file that are not in Parameter
in the frequency and completeness file.
Value
The output shows the completeness checks from the combined files. Each row applies to a completeness check for a parameter. The datarec
and qualrec
columns show the number of data records and qualified records, respectively. The datarec
column specifically shows only records not for quality control by excluding those as duplicates, blanks, or spikes in the count. The standard
column shows the relevant percentage required for the quality control check from the quality control objectives file, the complete
column shows the calculated completeness taken from the input data, and the met
column shows if the standard was met by comparing if complete
is greater than or equal to standard
.
Examples
##
# using file paths
# results path
respth <- system.file('extdata/ExampleResults.xlsx', package = 'MassWateR')
# frequency and completeness path
frecompth <- system.file('extdata/ExampleDQOFrequencyCompleteness.xlsx',
package = 'MassWateR')
qcMWRcom(res = respth, frecom = frecompth)
##
# using data frames
# results data
resdat <- readMWRresults(respth)
# frequency and completeness data
frecomdat <- readMWRfrecom(frecompth)
qcMWRcom(res = resdat, frecom = frecomdat)