Description Usage Arguments Details Value Examples
Calculates the period of record load duration curve from a data frame that includes mean daily flow and associated point measurements of pollutant concentration.
1 2 3 4 5 6 7 8 9 |
.tbl |
data frame with at least two columns Q (discharge or flow) and C (associated pollutant concentration). |
Q |
variable name in .tbl for discharge or flow. This must have unit set, typically "ft^3/s". |
C |
variable name in .tbl for associated pollutant concentration at a given flow value. This must have a unit set, typically "mg/L" or "cfu/100mL". |
allowable_concentration |
an object of class |
breaks |
a numeric vector of break points for flow categories. Must be
of length of labels + 1. defaults to |
labels |
labels for the categories specified by breaks. |
estimator |
numeric, one of |
The exceedance probability is calculated from the descending order of Daily Flows. By default, the Weibull plotting position is used:
p = P(Q > q_i) = \frac{i}{n+1}
where q_i, i = 1, 2, ... n, is the i-th sorted streamflow value.
object of class tibble. Includes variables in .tbl and Daily_Flow_Volume (discharge volume), Daily_Load (pollutant sample volume), P_Exceedance (exeedance probability), Flow_Category (as defined by breaks and labels).
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 | # Basic example using built in Tres Palacios data
library(dplyr)
library(units)
# Format data
install_unit("cfu")
df <- as_tibble(tres_palacios) %>%
## filter data so this run quicker
filter(!is.na(Indicator_Bacteria)) %>%
## flow must have units, here is is in cfs
mutate(Flow = set_units(Flow, "ft^3/s")) %>%
## pollutant concentration must have units
mutate(Indicator_Bacteria = set_units(Indicator_Bacteria, "cfu/100mL"))
# Calculate LDC
## specify the allowable concentration
allowable_concentration <- 126
## set the units
units(allowable_concentration) <- "cfu/100mL"
df_ldc <- calc_ldc(df,
Q = Flow,
C = Indicator_Bacteria,
allowable_concentration = allowable_concentration)
df_ldc
## cleanup
remove_unit("cfu")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.