add_hill_params: Add Hill model parameters

View source: R/add_tables.R

add_hill_paramsR Documentation

Add Hill model parameters

Description

Create or add to the 'hill_params' table in a GeoTox database.

Usage

add_hill_params(GT, hill_params)

Arguments

GT

GeoTox object.

hill_params

List output from fit_hill().

Value

The same GeoTox object, invisibly.

See Also

fit_hill()

Examples

# Example Hill model data
hill_df <- tibble::tribble(
  ~assay, ~model, ~casn, ~logc, ~resp,
  "a1", "human", "00-00-1",    0,  10,
  "a1", "human", "00-00-1",    1,  20,
  "a1", "human", "00-00-1",    2,  80,
  "a1", "human", "00-00-1",    3, 100,
  "a1", "human", "00-00-2", -0.5,   5,
  "a1", "human", "00-00-2",  0.5,  20,
  "a1", "human", "00-00-2",  1.5,  55,
  "a1", "human", "00-00-2",  2.5,  60,
  "a2",   "rat", "00-00-1",   -1,   0,
  "a2",   "rat", "00-00-1",    0,  10,
  "a2",   "rat", "00-00-1",    1,  30,
  "a2",   "rat", "00-00-1",    2,  40
)
hill_params <- fit_hill(
  hill_df, assay = c(name = "assay", model = "model"), substance = "casn"
)

# Add Hill model parameters to GeoTox database
GT <- GeoTox() |> add_hill_params(hill_params)

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

# Look at created tables

dplyr::tbl(con, "hill_params") |> dplyr::collect()

dplyr::tbl(con, "assay") |> dplyr::collect()

dplyr::tbl(con, "substance") |> 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.