knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette covers basic use of package functions. Package data, geo_tox_data
, is used throughout the examples and details on how it was created can be found in the "GeoTox Package Data" vignette.
library(GeoTox) library(dplyr) n <- 250 # Sample size
NOTE: The sample size here is the size of the simulated population in each region. This is different than the sample size in the "package_data" vignette, which is used to generate
C_ss
values for each chemical at specified age and weight combinations.
Create GeoTox object, run simulations and computations
set.seed(2357) geoTox <- GeoTox() |> # Set region and group boundaries (for plotting) set_boundaries(region = geo_tox_data$boundaries$county, group = geo_tox_data$boundaries$state) |> # Simulate populations for each region simulate_population(age = split(geo_tox_data$age, ~FIPS), obesity = geo_tox_data$obesity, exposure = split(geo_tox_data$exposure, ~FIPS), simulated_css = geo_tox_data$simulated_css, n = n) |> # Estimated Hill parameters set_hill_params(geo_tox_data$dose_response |> filter(endp == "TOX21_H2AX_HTRF_CHO_Agonist_ratio") |> fit_hill(chem = "casn") |> filter(!tp.sd.imputed, !logAC50.sd.imputed)) |> # Calculate response calculate_response() |> # Perform sensitivity analysis sensitivity_analysis() geoTox
Plot outputs
plot(geoTox) plot(geoTox, type = "hill") plot(geoTox, type = "sensitivity")
Create GeoTox object, run simulations and computations
set.seed(2357) geoTox <- GeoTox() |> # Set region and group boundaries (for plotting) set_boundaries(region = geo_tox_data$boundaries$county, group = geo_tox_data$boundaries$state) |> # Simulate populations for each region simulate_population(age = split(geo_tox_data$age, ~FIPS), obesity = geo_tox_data$obesity, exposure = split(geo_tox_data$exposure, ~FIPS), simulated_css = geo_tox_data$simulated_css, n = n) |> # Estimated Hill parameters set_hill_params(geo_tox_data$dose_response |> fit_hill(assay = "endp", chem = "casn") |> filter(!tp.sd.imputed, !logAC50.sd.imputed)) |> # Calculate response calculate_response() |> # Perform sensitivity analysis sensitivity_analysis() geoTox
Plot outputs
plot(geoTox) plot(geoTox, assays = "TOX21_H2AX_HTRF_CHO_Agonist_ratio") plot(geoTox, type = "hill") plot(geoTox, type = "sensitivity") plot(geoTox, type = "sensitivity", assay = "TOX21_H2AX_HTRF_CHO_Agonist_ratio")
The exposure map is the same for both single and multiple assay analyses. The map shows the distribution of chemical exposure across regions for all chemicals, not just those used in a particular analysis.
plot(geoTox, type = "exposure", ncol = 5)
If other facet labels are present they can be specified using the chem_label
argument.
plot(geoTox, type = "exposure", chem_label = "chnm", ncol = 5)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.