For these plots, data sets made long with respect to several
y-axis variables and then plotted and faceted with
ggplot2::facet_wrap().
Usage
wrap_cont_cont(
df,
x,
y,
...,
fun = pm_scatter,
title = NULL,
scales = "free_y",
ncol = NULL,
use_labels = TRUE,
label_fun = deprecated(),
labeller = label_tex
)
wrap_cont_time(df, ..., x = pm_axis_time())
wrap_res_time(df, ..., x = pm_axis_time())
wrap_eta_cont(df, x, y, scales = "fixed", ...)
wrap_hist(
df,
x,
title = NULL,
scales = "free_x",
ncol = NULL,
use_labels = TRUE,
labeller = label_tex,
label_fun = deprecated(),
...
)
wrap_dv_preds(df, ..., title = NULL, xname = "", scales = "fixed")
wrap_cont_cat(
df,
x,
y,
...,
title = NULL,
scales = "free_y",
ncol = NULL,
use_labels = TRUE,
labeller = label_tex,
label_fun = deprecated()
)Arguments
- df
data frame to plot.
- x
x-axis data in
col_label()format; ifyhas length greater than 1, thenxmust be length equal to 1.- y
y-axis data in
col_label()format; ifxhas length greater than 1, thenymust be length equal to 1.- ...
passed to
fun.- fun
the plotting function.
- title
a title to use for the axis with faceting groups.
- scales
passed to
facet_wrap.- ncol
passed to
facet_wrap.- use_labels
if
TRUE, look for an alternate facet label; if the data set was labeled withpm_label_columns(), use that label; otherwise use the label part of thecol_labelspecification. he label part ofcol_labelwill be used in the strip; the column name is used otherwise.- label_fun
deprecated; use
labellerinstead.- labeller
a labeller function; passed to
ggplot2::facet_wrap(); the default is based onparse_label()and allows latex markup in the label.- xname
placeholder.
Details
wrap_cont_cont is a general function used by
the others to create faceted plots of two continuous variables.
wrap_cont_time plots several continuous variables versus time.
wrap_res_time plots several different residuals (or NPDE) versus time.
wrap_eta_cont plots etas versus a continuous covariate. wrap_hist
creates a faceted histogram plot. wrap_cont_cat plots continuous versus
categorical data as a boxplot.
The following functions are called (as fun) to make each wrapped plot
wrap_cont_contcallspm_scatter()wrap_cont_timecallsy_time()wrap_res_timecallsres_time()wrap_eta_contcallseta_cont()wrap_histcallscont_hist()wrap_cont_catcallspm_box();
For all plots, both x and y should name numeric data columns with the
exception of wrap_cont_cat which expects x to name a categorical
data column (the data are sent to pm_box()).
When pm_box() is called by wrap_cont_cat, the shown argument will be
forced to the value FALSE.
For all plots, either x or y may contain multiple columns, but an error
will be generated if both x and y list multiple columns.
Facet strip labels can be updated after the fact using pmp_relabel_wrap(),
which looks up column names in a named list or yspec object.
