elfgen: Generate Ecological Limit Function (ELF)

View source: R/elfgen.R

elfgenR Documentation

Generate Ecological Limit Function (ELF)

Description

Generate ELF models by supplying a dataframe of richness and stream size data (streamflow or drainage area), a quantile for evaluating the ecological limit, and a breakpoint threshold.

Usage

elfgen(
  watershed.df,
  quantile,
  breakpt,
  yaxis_thresh,
  xlabel = FALSE,
  ylabel = FALSE,
  plot_title = FALSE,
  break_var = "x_var"
)

Arguments

watershed.df

A dataframe of sites with ecological and hydrologic data

quantile

A specified value for the quantile of interest - 0.95 equals the 95th percentile

breakpt

A breakpoint - either user-supplied fixed value or derived using elfgen breakpoint functions bkpt_pwit() or bkpt_ymax

yaxis_thresh

Value used for specifying y-axis max limit

xlabel

Used to overwrite default x-axis label

ylabel

Used to overwrite default y-axis label

plot_title

A plot title used to title the ggplot. If left as the default (FALSE), the plot will be titled using the name of the HUC from nhdPlus

break_var

The name of the variable in watershed.df to be filtered for by the breakpt, defaults to the expected name "x_var"

Value

Object containing plot image and dataframe of ELF statistics

Examples

#elfdata(watershed.code = '0208020104', ichthy.localpath = tempdir(), use_cache = FALSE)
breakpt <- 500
elfgen(
   "watershed.df" = watershed.df,
   "quantile" = 0.80,
   "breakpt" = breakpt,
   "xlabel" = "Mean Annual Flow (ft3/s)",
   "ylabel" = "Fish Species Richness"
   )

elfgen documentation built on May 23, 2026, 9:10 a.m.