utilMWRlimits {MassWateR} | R Documentation |
Fill results data as BDL or AQL with appropriate values
Description
Fill results data as BDL or AQL with appropriate values
Usage
utilMWRlimits(resdat, param, accdat, warn = TRUE)
Arguments
resdat |
results data as returned by |
param |
character string to filter results and check if a parameter in the |
accdat |
|
warn |
logical to return warnings to the console (default) |
Details
The param
argument is used to identify the appropriate "MDL"
or "UQL"
values in the data quality objectives file for accuracy. A warning is returned to the console if the accuracy file does not contain the appropriate information for the parameter. Results will be filtered by param
regardless of any warning.
Value
resdat
filtered by param
with any entries in "Result Value"
as "BDL"
or "AQL"
replaced with appropriate values in the "Quantitation Limit"
column, if present, otherwise the "MDL"
or "UQL"
columns from the data quality objectives file for accuracy are used. Values as "BDL"
use one half of the appropriate limit. Output only includes rows with the activity type as "Field Msr/Obs"
or "Sample-Routine"
.
Examples
# results file path
respth <- system.file('extdata/ExampleResults.xlsx', package = 'MassWateR')
# results data
resdat <- readMWRresults(respth)
# accuracy path
accpth <- system.file('extdata/ExampleDQOAccuracy.xlsx',
package = 'MassWateR')
# accuracy data
accdat <- readMWRacc(accpth)
# apply to total phosphorus
utilMWRlimits(resdat, accdat, param = 'TP')
# apply to E.coli
utilMWRlimits(resdat, accdat, param = 'E.coli')