pairs20x: Pairwise Scatter Plots with Histograms and Correlations

View source: R/pairs20x.R

pairs20xR Documentation

Pairwise Scatter Plots with Histograms and Correlations

Description

Plots pairwise scatter plots with histograms and correlations for the data frame.

Usage

pairs20x(x, na.rm = TRUE, engine = c("base", "ggplot2"), ...)

Arguments

x

a data frame.

na.rm

if TRUE then only complete cases will be displayed.

engine

plotting engine to use. The default, "base", preserves the original base graphics output. Use "ggplot2" for the optional ggplot2/GGally output.

...

optional arguments passed to the underlying plotting function.

Details

The default base graphics engine preserves the original s20x teaching plot and draws directly on the active graphics device. The optional ggplot2 engine uses GGally when both optional packages are installed and returns a reusable plot matrix for reports or further customisation. The ggplot2/GGally output is intentionally optional so existing teaching material can continue to rely on the base graphics default.

Value

Returns the plot.

See Also

'pairs', 'panel.smooth', 'panel.cor', 'panel.hist'

Examples


## Peruvian Indians
data(peru.df)
pairs20x(peru.df)

# Optional ggplot2/GGally engine for a reusable plot matrix
if (requireNamespace("ggplot2", quietly = TRUE) &&
    requireNamespace("GGally", quietly = TRUE)) {
  pairsPlot = pairs20x(peru.df, engine = "ggplot2")
  class(pairsPlot)
}


s20x documentation built on July 1, 2026, 9:06 a.m.