Skip to contents

Plot time profiles of observed and predicted values from GFO $SDTAB.

Usage

sg_gof_tp(
  fpath_i,
  pop = TRUE,
  filt = "T",
  cov_cols = NULL,
  col_i = NULL,
  DVID = 1,
  tsld = FALSE,
  f_scales = "free",
  sort_by = NULL,
  desc = FALSE,
  log_y = FALSE,
  lab_x = "Time since first dose, h",
  lab_y = "Plasma concentration, mmol/L",
  cap = str_c("empty circles - observed data\n", "solid lines - ",
    "individual predictions\n", "dashed grey lines ", "- population predictions"),
  n_quantiles = 3,
  levels_discrete = 10
)

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.

pop

Logical. If TRUE (default), adds population predictions (PRED) as dashed lines and points.

filt

String. Provide a filter to apply. Default is "T"

cov_cols

A character vector specifying the names of the columns with covariates.

col_i

String. Column name for color

DVID

Restrict SDTAB to one observation type. Numeric values select the DVID column (default 1). If SDTAB has DVNAME, a character or factor is matched to DVNAME first; otherwise a digit-only string is coerced to numeric DVID.

tsld

Logical. If TRUE, uses time since last dose instead of time from first dose. Default is FALSE.

f_scales

String, one of "fixed", "free", "free_x", "free_y". User can specify whether the scales (x and y axes) should be fixed across all panels ("fixed"), free for each panel ("free"), or free only in one dimension ("free_x" or "free_y"). Default is "fixed"

sort_by

Character vector of column names to sort ID facets by. Use "DOSE" to sort by last dose. Other names (e.g. covariates) must exist in GFO.

desc

Logical. If TRUE, sort in descending order for all columns in sort_by.

log_y

Logical. If TRUE, a logarithmic scale is applied to y-axis. Default is FALSE.

lab_x

String. X-ax label. Default is "Time since first dose, h"

lab_y

String. Y-ax label. Default is "Plasma concentration, mmol/L"

cap

String. Plot caption. Default is "empty circles - observed data solid lines - individual predictions dashed grey lines - population predictions"

n_quantiles

Integer. Number of quantile groups for continuous variables in col_i. Default is 3.

levels_discrete

Integer. Maximum unique values to consider a variable discrete. Default is 10.

Value

A list of plots with predicted time profiles, faceted by id

Examples

# \donttest{
fpath_i <- system.file("extdata", "simurg_object", "Warfarin_PK.RData",
                        package = "SimuRg")
plot_list <- sg_gof_tp(fpath_i)
plot_list[[1]]

# }