threshold_identification: Tabulate Threshold Exceedances

Description Usage Arguments Details Value Author(s) References Examples

View source: R/threshold_identification.R

Description

Tabulate user-specified threshold exceedances

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
threshold_identification(swmpr_in, ...)

## S3 method for class '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)

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)

Value

Returns a data frame of threshold exceedances by parameter

Author(s)

Julie Padilla

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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)


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('>'))

padilla410/SWMPrExtension documentation built on Dec. 29, 2021, 5:48 a.m.