mid.plots {midr} | R Documentation |
Plot Multiple MID Component Functions
Description
mid.plots()
applies ggmid()
or plot()
to the component functions of a "mid" object.
Usage
mid.plots(
object,
terms = mid.terms(object, interaction = FALSE),
limits = c(NA, NA),
intercept = FALSE,
main.effects = FALSE,
max.plots = NULL,
engine = c("ggplot2", "graphics"),
...
)
Arguments
object |
a "mid" object. |
terms |
a character vector. The names of the terms to be visualized. |
limits |
|
intercept |
logical. If |
main.effects |
logical. If |
max.plots |
an integer specifying the number of maximum number of plots. |
engine |
character string. One of "ggplot2" or "graphics". |
... |
optional parameters to be passed to |
Value
If engine
is "ggplot2", mid.plots()
returns a list of "ggplot" objects. Otherwise mid.plots()
produces plots and returns NULL
.
Examples
data(diamonds, package = "ggplot2")
set.seed(42)
idx <- sample(nrow(diamonds), 1e4L)
mid <- interpret(price ~ (carat + cut + color + clarity) ^ 2, diamonds[idx, ])
mid.plots(mid, c("carat", "color", "carat:color", "clarity:color"), limits = NULL)