#' Flow-survival relationship
#'
#' Calculates survival through a reach as a function of standardized flow in Sac3 reach
#'
#' @md
#' @param reach Sac1, Sac2, Sac3, or SS
#' @param flow Standardized flow in Sac3 on day entering reach
#'
#' @export
#' @examples
#' flow_survival("Sac1", -5)
#' flow_survival("Sac1", 0)
#' flow_survival("Sac1", 5)
#' flow_survival("SS", 0)
#'
flow_survival <- function(reach = c("Sac1", "Sac2", "Sac3", "SS"), flow){
reach <- match.arg(reach)
sac_slope <- 0.52
p <- flow_survival_params[[reach]]
exp(p[["B0"]] + sac_slope * flow)/(1 + exp(p[["B0"]] + sac_slope * flow))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.