Learn R Programming

SWMPrExtension (version 1.1.6)

threshold_identification: Tabulate Threshold Exceedances

Description

Tabulate user-specified threshold exceedances

Usage

threshold_identification(swmpr_in, ...)

# S3 method for swmpr threshold_identification( swmpr_in, param, parameter_threshold, threshold_type, time_threshold = NULL, ... )

Arguments

swmpr_in

input swmpr object

...

arguments passed to other methods

param

vector of parameters to evaluate

parameter_threshold

vector of numerical thresholds to evaluate parameters against

threshold_type

vector of logical operators ('<', '>', '<=', '>=', '==', '!=')

time_threshold

The amount of time an event must last to be counted (in hours)

Value

Returns a data frame of threshold exceedances by parameter

Details

This function creates tabular summary of events when a user-specified threshold is exceeded.

Before using this function, the user must apply setstep to normalize the datetimestamp time step.

For MET and WQ data, the user must specify time_threshold. This argument is the minimum duration that an event must last in order to be counted. For example, if time_threshold = 2, param = "do_mgl", parameter_threshold = 2, and threshold_type = "<" then dissolved oxygen must be lower than 2 mg/L for more than two hours or the event will not be summarized in the final table. For NUT parameters, all exceedances are included in the tabular summary.

Recommended thresholds for chlorophyll-a, dissolved inorganic nitrogen, dissolved inorganic phosphorus, and dissolved oxygen can be found in the National Coastal Condition Assessment 2010 (USEPA 2016)

References

United States Environmental Protection Agency (USEPA). 2015. "National Coastal Condition Assessment 2010". EPA 841-R-15-006. https://cfpub.epa.gov/si/si_public_record_Report.cfm?Lab=OWOW&dirEntryId=327030

Examples

Run this code
# NOT RUN {
data("apacpwq")
wq <- apacpwq

dat_wq <- qaqc(wq, qaqc_keep = c(0, 3, 5))
dat_wq <- setstep(dat_wq)

wq_pars<- threshold_identification(dat_wq, param = c('do_mgl', 'ph', 'temp')
                          , parameter_threshold = c(2, 5, 30)
                          , threshold_type = c('<', '<', '>'), time_threshold = 2)

# }
# NOT RUN {
wq_par<- threshold_identification(dat_wq, param = c('do_mgl')
                          , parameter_threshold = c(2)
                          , threshold_type = c('<'), time_threshold = 2)


## time_threshold and setstep are not necessary for monthly parameters
data("apacpnut")
nut <- apacpnut

dat_nut <- qaqc(nut, qaqc_keep = c(0, 3, 5))

nut_pars <- threshold_identification(dat_nut, param = c('chla_n', 'po4f')
                          , parameter_threshold = c(10, 0.01)
                          , threshold_type = c('>', '>'))

nut_par <- threshold_identification(dat_nut, param = c('chla_n')
                          , parameter_threshold = c(10)
                          , threshold_type = c('>'))

nut_err <- threshold_identification(dat_nut, param = c('chla_n')
                          , parameter_threshold = c(30)
                          , threshold_type = c('>'))

# }

Run the code above in your browser using DataLab