- object
An object of class emmGrid
, or a fitted model of a class
supported by the emmeans package
- formula
Formula of the form
trace.factors ~ x.factors | by.factors
. The EMMs are
plotted against x.factor
for each level of trace.factors
.
by.factors
is optional, but if present, it determines separate
panels. Each element of this formula may be a single factor in the model,
or a combination of factors using the *
operator.
- ...
Additional arguments passed to emmeans
(when
object
is not already an emmGrid
object),
predict.emmGrid
,
emmip_ggplot
, or emmip_lattice
.
- type
As in predict.emmGrid
, this determines
whether we want to inverse-transform the predictions
(type = "response"
) or not (any other choice). The default is
"link"
, unless the "predict.type"
option is in force; see
emm_options
.
In addition, the user may specify type = "scale"
to create a
transformed scale for the vertical axis based on object
's response
transformation or link function.
- CIs
Logical value. If TRUE
, confidence intervals (or HPD intervals
for Bayesian models) are added to the plot
(works only with engine = "ggplot"
).
- PIs
Logical value. If TRUE
, prediction intervals are added to the plot
(works only with engine = "ggplot"
). This is allowed only if the
underlying model family is "gaussian"
.
If both CIs
and
PIs
are TRUE
, the prediction intervals will be somewhat
longer, lighter, and thinner than the confidence intervals. Additional
parameters to predict.emmGrid
(e.g., sigma
) may be passed via
...
. For Bayesian models, PIs require frequentist = TRUE
and
a value for sigma
.
- style
Optional character value. This has an effect only when the
horizontal variable is a single numeric variable. If style
is
unspecified or "numeric"
, the horizontal scale will be numeric and
curves are plotted using lines (and no symbols). With style =
"factor"
, the horizontal variable is treated as the levels of a factor
(equally spaced along the horizontal scale), and curves are plotted using
lines and symbols. When the horizontal variable is character or factor, or
a combination of more than one predictor, "factor"
style is always used.
- engine
Character value matching "ggplot"
(default),
"lattice"
, or "none"
. The graphics engine to be used to produce the plot.
These require, respectively, the ggplot2 or lattice package to
be installed. Specifying "none"
is equivalent to setting plotit = FALSE
.
- plotit
Logical value. If TRUE
, a graphical object is returned;
if FALSE
, a data.frame is returned containing all the values
used to construct the plot.
- nesting.order
Logical value. If TRUE
, factors that are nested
are presented in order according to their nesting factors, even if those nesting
factors are not present in formula
. If FALSE
, only the
variables in formula
are used to order the variables.
- emms
A data.frame
created by calling emmip
with
plotit = FALSE
. Certain variables and attributes are expected
to exist in this data frame; see the section detailing the rendering functions.
- dodge
Numerical amount passed to ggplot2::position_dodge
by which points and intervals are offset so they do not collide.
- xlab, ylab, tlab
Character labels for the horizontal axis, vertical
axis, and traces (the different curves), respectively. The emmip
function generates these automatically and provides therm via the labs
attribute, but the user may override these if desired.
- facetlab
Labeller for facets (when by variables are in play).
Use "label_value"
to show just the factor levels, or "label_both"
to show both the factor names and factor levels. The default of
"label_context"
decides which based on how many by
factors there are.
See the documentation for ggplot2::label_context
.
- scale
If not missing, an object of class scales::trans
specifying
a (usually) nonlinear scaling for the vertical axis. For example,
scales = scales::log_trans()
specifies a logarithmic scale. For
fine-tuning purposes, additional
arguments to ggplot2::scale_y_continuous
may be included in ...
.
- dotarg
list
of arguments passed to geom_point
to customize appearance of points
- linearg
list
of arguments passed to geom_line
to customize appearance of lines
- CIarg, PIarg
list
s
of arguments passed to geom_linerange
to customize appearance of intervals.
(Note: the linetype
aesthetic defaults to "solid"
under the hood)
- col
With emmip_ggplot
, this adds color = col
(not
colour
) to all of the *arg
lists. This is intended for setting a
common color for everything, such as a black-and-white plot.
With emmip_lattice
, col
specifies the colors to use
for each group, recycled as needed. If not specified, the default trellis
colors are used.
- pch
(Lattice only) The plotting characters to use for each group (i.e., levels of
trace.factors
). They are recycled as needed.
- lty
(Lattice only) The line types to use for each group. Recycled as needed.