find_mec: Find the Maximum Observed Effluent Concentration (MEC)

Description Usage Arguments Value Examples

View source: R/summary_functions.R

Description

Find the MEC (no projection) from the observed dataset using methods described in EPA's Technical Support Document for Water Quality-based Toxics Control.

Usage

1
find_mec(qual, result, nd = c("<", "nd", "ND"), simple_output = FALSE)

Arguments

qual

A character vector containing non-detect indicator strings, e.g., "<" or "ND". The strings used to indicate censored status can be edited in the "nd" argument.

result

A numeric vector of concentration measurements.

nd

A list indicating all the censoring flags included in the dataset. Defaults to "<", "nd", and "ND".

simple_output

Logical value. If TRUE, the output columns are concatenated into a single character string (e.g., "<0.2") which can be useful for constructing summary tables.

Value

Dataframe with a qualifier column (character) and a MEC column (numeric).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Find observed MEC
cen_result <- c(rep("", 10), rep("<", 10))
result     <- 1:20
find_mec(cen_result, result)

cen_result <- rep("<", 20)
find_mec(cen_result, result)

cen_result <- rep("", 20)
find_mec(cen_result, result)

# Demonstrate simplified output
find_mec(cen_result, result, simple_output = TRUE)

# Define a set of custom non-detect flags
cen_result <- c(rep("non-detect", 5), rep("<", 10), rep("mdl", 5))
find_mec(cen_result, result, nd = c("non-detect", "<", "mdl"))

reasonabletools documentation built on Nov. 8, 2020, 4:24 p.m.