Skip to content

Commit

Permalink
export functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmineirx committed Jun 10, 2024
1 parent 3cd9781 commit 8520442
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export(covariates_table_to_list)
export(cv_to_omega)
export(detect_ode_syntax)
export(f_cov)
export(get_model_auc_compartment)
export(get_model_covariates)
export(get_model_fixed_parameters)
export(get_model_iov)
export(get_model_linearity)
export(get_model_parameters)
export(get_model_structure)
export(get_ode_model_size)
export(get_parameters_from_code)
export(get_var_y)
Expand Down
7 changes: 7 additions & 0 deletions R/get_model_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,43 @@ NULL
#' Get parameters required for a model
#' @rdname get_model_info
#' @returns get_model_parameters: returns a vector of PK parameter names
#' @export
get_model_parameters <- function(model) attr(model, "parameters")

#' Get covariates required for a model
#' @rdname get_model_info
#' @returns get_model_covariates: returns a vector of covariate names
#' @export
get_model_covariates <- function(model) attr(model, "covariates")

#' Get fixed parameters in model
#' @rdname get_model_info
#' @returns get_model_fixed_parameters: returns a vector of names of parameters
#' that are not associated with inter-individual or inter-occasion
#' variability.
#' @export
get_model_fixed_parameters <- function(model) attr(model, "fixed")

#' Get model structure
#' @rdname get_model_info
#' @returns get_model_structure: returns a single string indicating model
#' structure. E.g.,: "1cmt_iv", "2cmt_oral".
#' @export
get_model_structure <- function(model) attr(model, "misc")[["model_type"]]

#' Get model linearity
#' @rdname get_model_info
#' @returns get_model_linearity: returns a single string indicating model
#' linearity. E.g., "linear" or "nonlinear".
#' @export
get_model_linearity <- function(model) attr(model, "misc")[["linearity"]]

#' Get AUC compartment
#' @rdname get_model_info
#' @returns get_model_auc_compartment: returns the index of the final
#' compartment, which is conventionally the AUC compartment. Note: will not
#' detect if the final compartment is actually encoded to describe AUC.
#' @export
get_model_auc_compartment <- function(model) attr(model, "size")

#' Get inter-occasion variability specifications
Expand All @@ -52,4 +58,5 @@ get_model_auc_compartment <- function(model) attr(model, "size")
#' models without IOV, returns a single field (`list(n_bins = 1)`). Models
#' with IOV will return additional fields: n_bins, bin durations, and CV
#' associated with each PK parameter.
#' @export
get_model_iov <- function(model) attr(model, "iov")

0 comments on commit 8520442

Please sign in to comment.