multiPlot: Multiple plots on page

Description Usage Arguments Details Author(s)

Description

Lay out multiple ggplots on one frame or page.

Usage

1
multiPlot(..., plotlist = NULL, file, cols = 1, layout = NULL)

Arguments

...

Where the ggplot objects are placed to be laid out on the graph grid

plotlist

Can be used in place of the ... argument by specifying the ggplot objects as a list object

file

Not sure what this is used for

cols

Number of columns for the layout. For example cols=2 provides two columns and with four ggplot objects, the resulting output would be a 2 by 2 graphic

layout

A matrix that indicates the plot grid layout. For example, if layout = matrix(c(1, 2, 3, 3), nrow = 2, byrow = TRUE) the result would have plot 1 in the upper left, plot 2 in the upper right, and plot 3 would be go across the bottom

Details

This function, which was from http://www.cookbook-r.com/Graphs, is used to lay out several ggplot objects onto one frame or pdf page. For instance, you can have 3 plots on a page, one going vertically across the top, the other two in each corner on the bottom. This function makes up for the difficulty ggplot2 has with outputting multiple plots on one grid. This function depends on grid.

Author(s)

Cookbook R


lwjohnst86/rstatsToolkit documentation built on May 21, 2019, 9:15 a.m.