Following the xpose design pattern, this is a generic template
(analogous to xplot_boxplot() or xplot_pairs()) for rendering
already-summarized/binned data as connected points and/or lines across
a (typically discrete, possibly ordered) x variable. It is not tied to
any particular binning or summarization logic – callers are expected
to shape their data (eg via opt's post_processing) and build a named
implementation on top of it (eg catdv_vs_occ()) rather than calling
it directly for everyday use.
Usage
xplot_binned(
xpdb,
mapping = NULL,
group = "variable",
type = "pl",
xscale = "discrete",
yscale = "continuous",
title = NULL,
subtitle = NULL,
caption = NULL,
tag = NULL,
plot_name = "binned",
gg_theme,
xp_theme,
opt,
quiet,
...
)Arguments
- xpdb
<
xp_xtras> or <xpose_data> object- mapping
ggplot2style mapping. Expected to include at leastxandy.- group
Column name distinguishing multiple summarized series (eg a
variablecolumn). Points/lines/smooths are both connected and coloured by this column (seexpose::xplot_scatter()for the same connecting-line convention).- type
String setting the type of plot to be used: point
p, linel, and smooths, or any combination thereof.- xscale
Defaults to
discrete.- yscale
Defaults to
continuous.- title
Plot title
- subtitle
Plot subtitle
- caption
Plot caption
- tag
Plot tag
- plot_name
Metadata name of plot
- gg_theme
As in
xpose- xp_theme
As in
xpose- opt
Processing options for fetched data
- quiet
Silence extra debugging output
- ...
Additional aesthetics, passed to the
point,lineandsmoothlayers.
Details
Unlike xpose::xplot_scatter()'s raw per-subject spaghetti plots,
xplot_binned() assumes the supplied data is already one row per
x/group combination (eg per occasion, per series) – it does no binning,
aggregation, or tidying of its own.
