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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
calculate_metrics(
  df_month,
  dts = c(1, 3, 12),
  metrics = c("median_level", "cv_level", "exceedance_level", "volume", "area",
    "mean_depth", "max_depth", "centrarchid_substrate", "vegetation_area",
    "exceedance_range", "depart_median", "median_dur", "cv_dur", "num_dur", "num_2yr",
    "median_rise_rate", "cv_rise_rate", "median_fall_rate", "cv_fall_rate", "fast_rise",
    "fast_fall", "good_spawning", "move_dock", "turtle_bay", "stratification", "is_lake",
    "paddlesports", "motorboat", "season_compare", "fast_rise_decade",
    "fast_fall_decade", "num_dur_decade", "num_2yr_decade",      "move_dock_decade"),
  dur_exceeds = NULL
)

Arguments

df_month

data frame to use. Must include columns for "date" (must be POSIXct), "lake" (must be factor), and one with the lake levels (named in "col_name" argument).

dts

vector of dt values (months) to calculate metrics for, defaults to 1 (monthly), 3 (seasonal), and 12 (annual).

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

dur_exceeds

optional data frame with columns for "lake" and exceedance probabilities (e.g., "10", "25", "50", "75", "90) and associated lake levels. Used to calculate durations above/below these levels. Defaults to NULL to calculate durations on exceedance proababilities on provided time series.

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

series

type of time series used (monthly, seasonal, annual)


WDNR-Water-Use/CSLSscenarios documentation built on Nov. 10, 2021, 4:14 p.m.