R/get_fixed_parameters.R

Defines functions get_fixed_parameters

Documented in get_fixed_parameters

#' Get fixed parameters
#'
#' Get fixed parameters listed in model definition if present. If not present, use size of omega matrix to determine fixed parameters.
#'
#' @param def Model definition as output by [read_model_json()]
#' @md
get_fixed_parameters <- function(def) {
  # if fixed parameters are defined as null, i.e. written in the JSON as
  # `"fixed": null`, then we still want to use that, so that's why this isn't
  # written as `if (!is.null(def$fixed))`
  if ("fixed" %in% names(def)) {
    return(def$fixed)
  }
  n_estimated <- lower_triangle_mat_size(def$omega)
  names(tail(def$parameters, -n_estimated))
}

Try the PKPDsim package in your browser

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

PKPDsim documentation built on March 7, 2023, 5:40 p.m.