qcMWRcom | R Documentation |
Run quality control completeness checks for water quality monitoring results
qcMWRcom(
res = NULL,
frecom = NULL,
cens = NULL,
fset = NULL,
runchk = TRUE,
warn = TRUE
)
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 |
cens |
character string of path to the censored data file 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) |
The function can be used with inputs as paths to the relevant files or as data frames returned by readMWRresults
, readMWRfrecom
, and readMWRcens
(optional). 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.
A similar warning is returned if there are parameters in the censored data, if provided, that are not in the results file. However, an error is returned if there are parameters in the data quality objectives frequency and completeness file that are not in the censored data file.
All warnings can be suppressed by setting warn = FALSE
.
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
.
##
# 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')
# censored path
censpth <- system.file('extdata/ExampleCensored.xlsx',
package = 'MassWateR')
qcMWRcom(res = respth, frecom = frecompth, cens = censpth)
##
# using data frames
# results data
resdat <- readMWRresults(respth)
# frequency and completeness data
frecomdat <- readMWRfrecom(frecompth)
# censored data
censdat <- readMWRcens(censpth)
qcMWRcom(res = resdat, frecom = frecomdat, cens = censdat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.