GGally (version 1.2.0)

ggmatrix: ggpairs - A ggplot2 Matrix

Description

Make a generic matrix of ggplot2 plots

Usage

ggmatrix(plots, nrow, ncol, xAxisLabels = NULL, yAxisLabels = NULL, title = NULL, byrow = TRUE, showStrips = NULL, showAxisPlotLabels = TRUE, showXAxisPlotLabels = TRUE, showYAxisPlotLabels = TRUE, verbose = FALSE, data = NULL, gg = NULL, legends = FALSE)

Arguments

plots
list of plots to be put into matrix
nrow, ncol
number of rows and columns
xAxisLabels, yAxisLabels, title
labels for plot. Set the variable to NULL to not be displayed
byrow
boolean that determines whether the plots should be ordered by row or by column
showStrips
boolean to determine if each plot's strips should be displayed. NULL will default to the top and right side plots only. TRUE or FALSE will turn all strips on or off respectively.
showAxisPlotLabels, showXAxisPlotLabels, showYAxisPlotLabels
booleans that determine if the plots axis labels are printed on the X (bottom) or Y (left) part of the plot matrix. If showAxisPlotLabels is set, both showXAxisPlotLabels and showYAxisPlotLabels will be set to the given value.
verbose
boolean to determine the printing of "Plot #1, Plot #2...."
data
data set using. This is the data to be used in place of 'ggally_data' if the plot is a string to be evaluated at print time
gg
ggplot2 theme objects to be applied to every plot
legends
boolean to determine the printing of the legend in each plot. Not recommended.

Examples

Run this code
plotList <- list()
for (i in 1:6) {
  plotList[[i]] <- ggally_text(paste("Plot #", i, sep = ""))
}
a <- ggmatrix(
  plotList,
  2, 3,
  c("A", "B", "C"),
  c("D", "E"),
  byrow = TRUE
)
#a

a <- ggmatrix(
  plotList,
  2, 3,
  xAxisLabels = c("A", "B", "C"),
  yAxisLabels = NULL,
  byrow = FALSE,
  showXAxisPlotLabels = FALSE
)
#a

Run the code above in your browser using DataLab