get_row_contamination_probability | R Documentation |
Get probability of contamination of row
get_row_contamination_probability(params_row)
params_row |
|
params_row
must contain the following named variables:
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
)
## Not run:
library(units)
params_row <- tibble(
z1 = set_units(10, "ft"),
z2 = set_units(20, "ft"),
rs = set_units(15, "ft"),
density = set_units(1, "1/acre"),
area = set_units(64, "acre"),
self_treat = TRUE,
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")
get_row_contamination_probability(params_row)
# This function allows multiple rows to be calculated at once
params_df <- params_row %>% dplyr::select(-density, -rs, -self_treat) %>%
tidyr::crossing(density = set_units(c(0, 1), "1/acre"),
rs = set_units(c(10, 20),"ft"), self_treat = c(TRUE, FALSE))
# use sapply to get all probabilities at once
params_df$probs <- sapply(split(params_df, 1:nrow(params_df)), get_row_contamination_probability)
params_df
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.