calculate_metrics: Calculate hydrologic metrics evaluated in the CSLS

Description Usage Arguments Value

View source: R/calculate_metrics.R

Description

This function calculates hydrologic metrics describing the magnitude, frequency, duration, rate of change, and timing of lake levels. Specific metrics calculated include:

Usage

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")
)

Arguments

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").

Value

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


WDNR-Water-Use/CSLSlevels documentation built on Nov. 21, 2020, 9:13 a.m.