autoplot.pairwise | R Documentation |
Plotting method for pairwise objects.
autoplot.pairwise(object, ...)
## S3 method for class 'pairwise'
plot(x, y, ...)
object |
A |
... |
Additional arguments passed to the plotting geom. |
x |
A |
y |
Ignored, required for compatibility with the |
This function requires an optional dependency: ggplot2
.
When this package is installed, calling autoplot()
or plot
on a pairwise
object will
generate a plot of the pairwise comparisons. The plot will show the differences between the
groups, with error bars representing the confidence intervals. The x-axis will be labeled with
the type of confidence interval used and the values of the differences, and the y-axis will be
labeled with the groups being compared. A dashed line at 0 is included to help visualize the
differences.
if (require(ggplot2)) {
# generate the plot immediately
pairwise(lm(mpg ~ factor(am) + disp, data = mtcars), plot = TRUE)
# or save the object and plot it later
p <- pairwise(lm(mpg ~ factor(am) + disp, data = mtcars))
plot(p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.