| add_exposure_rate_params | R Documentation |
Create or add to the 'exposure_rate_params' table in a GeoTox database.
add_exposure_rate_params(
GT,
route = "inhalation",
params = NULL,
overwrite = FALSE
)
GT |
GeoTox object. |
route |
Exposure route (default "inhalation"). |
params |
Data frame with exposure rate parameters. If |
overwrite |
Logical indicating whether to overwrite existing exposure
rate parameters for the specified |
There are two routes with built-in default exposure rate parameters:
"inhalation" and "drinking". If params is not provided (NULL), the
default parameters for the specified route will be used. If params is
provided, it must contain columns "age_lb", "age_ub", "mean", and "sd". The
exposure rate parameters are used by simulate_exposure_rate() to generate
exposure rate samples for each individual in the population.
The build-in parameters come from the following sources:
Inhalation: EPA Exposure Factors Handbook (2015), Table 6.7
in m^3/kg-day. The "mean" and "sd" values are the average of male and
female values.
Drinking: EPA Exposure Factors Handbook (2019), Table 3-30 in mL/kg-day.
The same GeoTox object, invisibly.
simulate_exposure_rate()
# Add both default params to GeoTox database
GT <- GeoTox() |>
add_exposure_rate_params() |>
add_exposure_rate_params(route = "drinking")
# Open a connection to GeoTox database
con <- get_con(GT)
# Look at relevant tables
params_tbl <- dplyr::tbl(con, "exposure_rate_params") |> dplyr::collect()
params_tbl |> dplyr::filter(route_id == 1)
params_tbl |> dplyr::filter(route_id == 2)
dplyr::tbl(con, "route") |> dplyr::collect()
# Add custom params with new column (gender), assign to route "custom"
params_df <- tibble::tribble(
~age_lb, ~age_ub, ~gender, ~mean, ~sd,
0, 49, "male", 10, 1,
50, 99, "male", 20, 1,
0, 49, "female", 30, 1,
50, 99, "female", 40, 1
)
GT |> add_exposure_rate_params(params_df, route = "custom")
# Look at updated tables
params_tbl <- dplyr::tbl(con, "exposure_rate_params") |> dplyr::collect()
params_tbl |> dplyr::filter(route_id == 1)
params_tbl |> dplyr::filter(route_id == 2)
params_tbl |> dplyr::filter(route_id == 3)
dplyr::tbl(con, "route") |> dplyr::collect()
# Clean up example
DBI::dbDisconnect(con)
file.remove(GT$db_info$dbdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.