strs_surf | R Documentation |
Plot probability surface for likelihood of habitat or water quality stress
strs_surf(xvar, yvar, mod = c("hab_mod", "wq_mod"), mod_in = NULL, title = TRUE, lenv = 200, opt_vrs = NULL, low = "#2c7bb6", mid = "#ffffbf", high = "#d7191c")
xvar |
chr string of variable for x-axis |
yvar |
chr string of variable for y-axis |
mod |
chr string of habitat or water quality model to use, must be either |
mod_in |
chr string of model to use (GLM), appropriate for |
title |
logical indicating if title is shown above plot |
lenv |
numeric indicating resolution of probability surface |
opt_vrs |
names list with optional constant values for variables not specified by |
low |
chr string for color on low end of palette |
mid |
chr string for color at mid range of palette |
high |
chr string for color at high end of palette |
Plots a smooth surface of the likelihood of either habitat or water quality stress for selected ranges of two variables. The remaining variables are held constant at average values for those in the calibration dataset unless manually set with user input.
A ggplot
object
# water quality stress opt_vrs <- list( TN = 2.22, TP = 0.156, Cond = 100 ) strs_surf(xvar = 'TN', yvar = 'TP', mod = 'wq_mod', mod_in = 'wqglm', opt_vrs = opt_vrs) # habitat stress opt_vrs <- list( hy = 100, PCT_SAFN = 1, XCMG = 1 ) # hab strs_surf(xvar = 'hy', yvar = 'PCT_SAFN', mod = 'hab_mod', mod_in = 'habglm', opt_vrs = opt_vrs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.