get_contamination_probabilities: Get probabilities of contamination

View source: R/gw-model.R

get_contamination_probabilitiesR Documentation

Get probabilities of contamination

Description

Get probabilities of contamination

Usage

get_contamination_probabilities(params_df, show_progress = FALSE)

Arguments

params_df

tibble with appropriate columns (see details)

show_progress

boolean, whether or not to show progress bar

Details

params_df must contain the following named columns:

  • z1, z2, rs, density, area must be units objects.

  • self_treat is a boolean

  • theta_range should be in radians as c(theta_min, theta_max)

  • alpha_range should be in radians as c(alpha_min, alpha_max)

  • hh_array_type character as "septic" or "well" (see get_septic_well_array)

Examples

library(units)
library(tidyr)
params_row <- tibble(
  z1 = set_units(10, "ft"),
  z2 = set_units(20, "ft"),
  area = set_units(64, "acre"),
  theta_range = list(c(0, pi/4)), # this will be unlisted in the function
  alpha_range = list(c(0, 20)), # this will be unlisted in the function
  hh_array_type = "septic")

# This function allows multiple rows to be calculated at once
params_df <- params_row %>%
  crossing(density = set_units(c(0, 0.5), "1/acre"),
  rs = set_units(c(10, 20),"ft"), self_treat = c(TRUE, FALSE))

params_df$probs <- get_contamination_probabilities(params_df)
params_df

gopalpenny/nitratesgame documentation built on July 8, 2023, 6:10 p.m.