DV is plotted with a symbol while PRED and IPRED are plotted with lines
and symbols. The plot is faceted by unique individual identifier (like ID
or USUBJID) as well as other faceting variables.
Usage
dv_pred_ipred(
data,
id_per_plot = 9,
facets = pm_col_id(),
nrow = NULL,
ncol = NULL,
fun = NULL,
...,
id_col = deprecated()
)
dv_pred_ipred_impl(
data,
x = pm_axis_time(),
dv = pm_axis_dv(),
pred = pm_axis_pred(),
ipred = pm_axis_ipred(),
facets = pm_col_id(),
id_col = deprecated(),
xbreaks = waiver(),
xunit = pm_opts$time.unit,
xlab = NULL,
ylab = NULL,
angle = NULL,
strip.text = element_text(),
font_size = deprecated(),
margin = deprecated(),
plot.margin = NULL,
legend.position = "top",
pred_lty = 2,
ipred_lty = 1,
pred_point = TRUE,
ipred_point = TRUE,
lwd = 0.5,
size = pm_opts$scatter.size,
dv_shape = 19,
dv_line = FALSE,
dv_lwd = 0.5,
scales = "free",
log_y = FALSE,
use_theme = pm_theme(),
dv_color = "black",
ipred_color = "red2",
pred_color = "blue2",
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 unique combinations of
facetscolumns to include on each page.- facets
a character vector of column names to use for faceting the plot, passed to
ggplot2::facet_wrap(); if passed incol_label()format, then the column data is modified with a call toglue::glue_data(), so that the strip label is more informative; see examples.- 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; if supplied, this function is applied to each plot in the output list.
- ...
additional arguments passed to
dv_pred_ipred_impl().- id_col
deprecated; use
facetsargument instead.- x
the time-axis column, in
col_label()format; the title portion is used for the x-axis title along withxunit; see also thexlabargument.- dv
the
DVcolumn, incol_label()format; the title portion is used for the y-axis title; see also theylabargument.- pred
the name of the
PREDcolumn;col_label()format is allowed, but the label portion is discarded.- ipred
the name of the
IPREDcolumn;col_label()format is allowed, but the label portion is discarded.- xbreaks
x-axis (time) breaks; passed to
ggplot2::scale_x_continuous().- xunit
used to form x-axis title only if
xlabis not provided.- xlab
x-axis title; if not
NULL, passed toggplot2::xlab().- ylab
y-axis title; if not
NULL, passed toggplot2::ylab().- angle
rotation angle for x-axis tick labels; passed to
rot_x().- strip.text
optionally, the result of
ggplot2::element_text()to format the strip text (e.g. change the font size or padding).- font_size
deprecated.
- margin
deprecated.
- plot.margin
for the plot; passed
ggplot2::theme().- legend.position
passed to
ggplot2::theme().- pred_lty
PREDlinetype; passed toggplot2::geom_line().- ipred_lty
IPREDlinetype; passed toggplot2::geom_line().- pred_point
logical; should points be plotted for
PRED?- ipred_point
logical; should points be plotted for
IPRED?- lwd
line width for
PREDandIPRED; passed toggplot2::geom_line().- size
size of shape for
DV,IPREDandPRED; passed toggplot2::geom_point().- dv_shape
shape for
DV; passed toggplot2::geom_point().- dv_line
logical; if
TRUEthen a line is added to the plot connectingDVpoints.- dv_lwd
line width for
DV; passed toggplot2::geom_line()aslwd.- scales
passed to
ggplot2::facet_wrap().- log_y
logical; if
TRUEthen y-axis is shown in log-scale.- use_theme
a theme to use for the plot.
- dv_color
color to use for
DVpoints.- ipred_color
color to use for
IPREDline.- pred_color
color to use for
PREDline.- 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
Examples
data <- pmplots_data_obs()
p <- dv_pred_ipred(
data,
ylab = "Concentration (ng/mL)",
nrow = 3, ncol = 3
)
p <- dv_pred_ipred(
data,
facets = c("ID", "STUDYc//Study: {STUDYc}")
)
