R/set_hill_params.R

Defines functions set_hill_params

Documented in set_hill_params

#' Set Hill parameters for a GeoTox object.
#'
#' @param x GeoTox object.
#' @param hill_params output of [fit_hill].
#'
#' @return same GeoTox object with Hill parameters set.
#' @export
#'
#' @examples
#' hill_params <- geo_tox_data$dose_response |>
#'   fit_hill(chem = "casn", assay = "endp") |>
#'   dplyr::filter(!tp.sd.imputed, !logAC50.sd.imputed)
#'
#' geoTox <- GeoTox() |> 
#'   set_hill_params(hill_params)
set_hill_params <- function(x, hill_params) {
  x$hill_params <- hill_params
  # Clear downstream fields
  if (!is.null(x$resp) | !is.null(x$sensitivity)) {
    warning("Clearing 'resp' and 'sensitivity' fields")
    x$resp <- NULL
    x$sensitivity <- NULL
  }
  x
}

Try the GeoTox package in your browser

Any scripts or data that you put into this service are public.

GeoTox documentation built on April 4, 2025, 5:07 a.m.