Description Usage Arguments Value
View source: R/calculate_metrics.R
This function calculates hydrologic metrics describing the magnitude, frequency, duration, rate of change, and timing of lake levels. Specific metrics calculated include:
median_level: median monthly and overall lake levels
cv_level: coefficient of variation for monthly and overall lake levels
exceedance_level: lake levels corresponding to 10%, 25%, 50%, 75%, and 90% exceedance probabilities
exceedance_range: range between 25% and 75% exceedance probabilities and 10% and 90% exceedance probabilities for all levels and annual mean levels.
median_dur: median duration at/above the 10% and 25% exceedance probabilities or at/below the 75% and 90% exceedance probabilities.
cv_dur: coefficient of vatiation for durations at/above the 10% and 25% exceedance probabilities and at/below the 75% and 90% exceedance probabilities.
median_rise_rate: median lake level rise over 1 month, 3 months (seasonal), and 12 months (annual).
cv_rise_rate: coefficient of variation in lake level rise over 1 month, 3 months (seasonal), and 12 months (annual).
median_fall_rate: median lake level rise over 1 month, 3 months (seasonal), and 12 months (annual).
cv_fall_rate: coefficient of variation in lake level rise over 1 month, 3 months (seasonal), and 12 months (annual).
1 2 3 4 5 6 7 8 | calculate_metrics(
df = CSLSlevels::hist_levels,
metrics = c("median_level", "cv_level", "exceedance_level", "exceedance_range",
"depart_median", "median_dur", "median_dur_seas", "cv_dur", "cv_dur_seas", "num_dur",
"num_dur_seas", "num_2yr", "num_2yr_seas", "num_dur_decade", "num_dur_decade_seas",
"num_2yr_decade", "num_2yr_decade_seas", "median_rise_rate", "cv_rise_rate",
"median_fall_rate", "cv_fall_rate", "fast_rise", "fast_fall", "good_spawning")
)
|
df |
data frame to use, defaults "CSLSlevels::hist_levels". Must include columns for "date" (must be POSIXct), "lake" (must be factor), and one with the lake levels (named in "col_name" argument). |
metrics |
a list of which metrics to use. Defaults to all of them c("median_level", "cv_level", "exceedance_level", "exceedance_range", "median_dur", "cv_dur", "median_rise_rate", "cv_rise_rate", "median_fall_rate", "cv_fall_rate"). |
summary, a data frame with the following columns:
lake |
name of lake, character |
metric |
name of metric, corresponds with values in inputted "metrics" argument, character |
variable |
identifier for different types of metric. For example, the metric "median_rise_rate" will have variables of "1", "3", and "12" associated with it indicating the median rate over 1 month, 3 months, and 12 months, character |
value |
calculated value of the metric, numeric |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.