richness_change: Calculate change in richness resulting from a percent...

View source: R/richness-change.R

richness_changeR Documentation

Calculate change in richness resulting from a percent reduction in flow

Description

Calculates absolute or percent richness change from streamflow reduction

Usage

richness_change(stats, pctchg, xval = FALSE)

Arguments

stats

A dataframe of ELF statistics

pctchg

Decrease in flow as a percent (e.g. 10 equals 10 percent reduction in flow).

xval

x-axis value for assessing percent change in richness. When supplied, the function will calculate percent change in richness at a specific stream size (e.g. 50 equals a stream size with mean annual flow of 50 cfs).

Value

Richness change value is returned

Examples


# We don't run this example by R CMD check, because it takes >10s

watershed.df <- elfdata(watershed.code = '0208020104', ichthy.localpath = tempdir())
breakpt <- 500
elf <- elfgen(
   "watershed.df" = watershed.df,
   "quantile" = 0.95,
   "breakpt" = breakpt,
   "xlabel" = "Mean Annual Flow (ft3/s)",
   "ylabel" = "Fish Species Richness"
   )
# Calculate absolute richness change
richness_change(elf$stats, "pctchg" = 10)
# Calculate percent richness change at a specific stream size
richness_change(elf$stats, "pctchg" = 10, "xval" = 50)


elfgen documentation built on Aug. 23, 2022, 5:07 p.m.