DV is plotted with a symbol while PRED and IPRED are plotted with lines. The plot is faceted by unique individual identifier (like ID or USUBJID).

dv_pred_ipred(
  data,
  id_per_plot = 9,
  id_col = "ID",
  nrow = NULL,
  ncol = NULL,
  fun = NULL,
  ...
)

dv_pred_ipred_impl(
  data,
  x = pm_axis_time(),
  dv = pm_axis_dv(),
  pred = pm_axis_pred(),
  ipred = pm_axis_ipred(),
  id_col = "USUBJID",
  xbreaks = waiver(),
  xunit = opts$time.unit,
  xlab = NULL,
  ylab = NULL,
  angle = NULL,
  font_size = 7,
  margin = 1,
  legend.position = "top",
  pred_lty = 2,
  ipred_lty = 1,
  lwd = 0.7,
  size = opts$scatter.size,
  dv_shape = 1,
  dv_line = FALSE,
  dv_lwd = 0.5,
  scales = "free",
  log_y = FALSE,
  use_theme = theme_plain(),
  dv_color = "black",
  ipred_color = "firebrick",
  pred_color = "darkslateblue",
  ncol = NULL,
  nrow = NULL,
  axis.text.rel = NULL,
  fun = NULL
)

do_dv_pred_ipred(data, options = list())

Arguments

data

the data frame to plot

id_per_plot

number of subjects to include in each page

id_col

the column name for the subject identifier; the value will be displayed in the plot strip

nrow

number of rows in the plot grid; passed to ggplot2::facet_wrap

ncol

number of columns in the plot grid; passed to ggplot2::facet_wrap

fun

a function accepting a gg object as argument and returning an updated gg object; experimental

...

additional arguments passed to dv_pred_ipred_impl

x

the time-axis column, in col_label format; the title portion is used for the x-axis title along with xunit; see also the xlab argument

dv

the DV column, in col_label format; the title portion is used for the y-axis title; see also the ylab argument

pred

the name of the PRED column; col_label format is allowed, but the label portion is discarded

ipred

the name of the IPRED column; col_label format is allowed, but the label portion is discarded

xbreaks

x-axis breaks; passed to ggplot2::scale_x_continuous

xunit

used to form x-axis title only if xlab is not provided

xlab

x-axis title; if not NULL, passed to ggplot2::xlab

ylab

y-axis title; if not NULL, passed to ggplot2::ylab

angle

rotation angle for x-axis tick labels; passed to rot_x

font_size

the font size for strip text

margin

the top and bottom margin for the plot strip; passed to ggplot2::margin as t and b

legend.position

passed to ggplot2::theme

pred_lty

PRED linetype; passed to ggplot2::geom_line

ipred_lty

IPRED linetype; passed to ggplot2::geom_line

lwd

line width for PRED and IPRED; passed to ggplot2::geom_line

size

size of shape for DV; passed to ggplot2::geom_point

dv_shape

shape for DV; passed to ggplot2::geom_point

dv_line

logical; if TRUE then a line is added to the plot connecting DV points

dv_lwd

line width for DV; passed to ggplot2::geom_line as lwd

scales

passed to ggplot2::facet_wrap

log_y

logical; if TRUE then y-axis is shown in log-scale

use_theme

a theme to use for the plot

dv_color

color to use for DV points

ipred_color

color to use for IPRED line

pred_color

color to use for PRED line

axis.text.rel

relative text size for axis text; use this to selectively decrease font size for axis tick labels

options

a named list of options to pass to dv_pred_ipred

Details

if both nrow and ncol are supplied and numeric, id_per_plot will be set to nrow*ncol.

Examples

data <- pmplots_data_obs() p <- dv_pred_ipred(data, ylab="Concentration (ng/mL)", nrow=3, ncol=3)