Skip to contents

Generates ggplot2 visualizations for either random effects (RE) or individual parameters (IndPar) versus continuous or categorical covariates from a GFO.

Usage

sg_gof_par_cov(fpath_i, ptype = "REvsCov", cat_cov = NULL, cont_cov = NULL)

Arguments

fpath_i

String, GFO, or a named list with a GFO component (and optionally GCO). If a string is given, the path to a .RData or .json file with a fit object is expected.

ptype

Character. Type of plot: "REvsCov" for random effects or "IndParvsCov" for individual parameters.

cat_cov

Optional tibble with categorical covariates. Must have columns COV and optionally COVNAME for labels.

cont_cov

Optional tibble with continuous covariates. Must have columns COV and optionally COVNAME for labels.

Value

A list of ggplot objects. Returns versus continious covariates vs_contcov and versus categorical covariates vs_catcov plots.

Examples

library(tibble)
cont_cov <- tibble(
  COV = c("AGE", "WEIGHT"),
  COVNAME = c("Age, years", "Body weight, kg")
)
cat_cov <- tibble(
  COV = c("SEX", "VKORC1_gentyp"),
  COVNAME = c("Sex, M/F", "VKORC1 genotype")
)
fpath_i <- system.file("extdata", "simurg_object", "Warfarin_PK.RData", package = "SimuRg")
p <- sg_gof_par_cov(
  fpath_i = fpath_i,
  ptype = "IndParvsCov",
  cont_cov = cont_cov,
  cat_cov = cat_cov
)
p$vs_contcov

p$vs_catcov