get_concentration_mean: Get concentration mean values

View source: R/get_concentration_mean.R

get_concentration_meanR Documentation

Get concentration mean values

Description

Calculates the concentration mean values for each substance and route at each location based on the data in the 'concentration' and 'sample' tables of the GeoTox database. The output of this function is useful for plotting or further analysis.

Usage

get_concentration_mean(GT, col)

Arguments

GT

GeoTox object.

col

Column name in the 'concentration' table for which to calculate the mean, grouped by substance, route, and location.

Details

The col parameter specifies which column in the 'concentration' table to use for the mean calculation. The available choices will depend on what data has been stored in the 'concentration' table during the simulation process.

Value

A data frame.

Examples

# Setup required tables
exposure_df <- tibble::tribble(
  ~FIPS, ~casn, ~route, ~mean, ~sd,
  10000, "00-00-1", "inhalation", 10, 1,
  10000, "00-00-2", "inhalation", 20, 1,
  20000, "00-00-1", "inhalation", 30, 1,
  20000, "00-00-2", "inhalation", 40, 1
)
GT <- GeoTox() |>
  add_exposure(exposure_df) |>
  simulate_exposure(n = 100)

# Calculate mean external concentration by substance and location
get_concentration_mean(GT, "C_ext")

# Open a connection to GeoTox database
con <- get_con(GT)

# Look at column names in the 'concentration' table
dplyr::tbl(con, "concentration") |> dplyr::collect()

# Clean up example
DBI::dbDisconnect(con)
file.remove(GT$db_info$dbdir)

GeoTox documentation built on May 20, 2026, 1:07 a.m.