autoplot.pairwise: Plotting method for pairwise objects.

View source: R/pairwise.R

autoplot.pairwiseR Documentation

Plotting method for pairwise objects.

Description

Plotting method for pairwise objects.

Usage

autoplot.pairwise(object, ...)

## S3 method for class 'pairwise'
plot(x, y, ...)

Arguments

object

A pairwise object.

...

Additional arguments passed to the plotting geom.

x

A pairwise object.

y

Ignored, required for compatibility with the plot() generic.

Details

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.

Examples

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)
}

UCLATALL/supernova documentation built on Feb. 13, 2024, 6:57 a.m.