| pairs20x | R Documentation |
Plots pairwise scatter plots with histograms and correlations for the data frame.
pairs20x(x, na.rm = TRUE, engine = c("base", "ggplot2"), ...)
x |
a data frame. |
na.rm |
if TRUE then only complete cases will be displayed. |
engine |
plotting engine to use. The default, |
... |
optional arguments passed to the underlying plotting function. |
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.
Returns the plot.
'pairs', 'panel.smooth', 'panel.cor', 'panel.hist'
## 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.