% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/add_tables.R
\name{add_hill_params}
\alias{add_hill_params}
\title{Add Hill model parameters}
\usage{
add_hill_params(GT, hill_params)
}
\arguments{
\item{GT}{GeoTox object.}

\item{hill_params}{List output from \code{\link[=fit_hill]{fit_hill()}}.}
}
\value{
The same GeoTox object, invisibly.
}
\description{
Create or add to the 'hill_params' table in a GeoTox database.
}
\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)
}
\seealso{
\code{\link[=fit_hill]{fit_hill()}}
}
