grid_arrange_share_legend: Common legend for two or more 'gg' grobs.

Description Usage Arguments Value Note Examples

View source: R/grid_arrange_share_legend.R

Description

Almost all parts of the function is borrowed from 'vignette(package = "gridExtra", "arrangeGrob")'. Refer to this vignettee for extra details.

Usage

1
2
3
4
5
6
grid_arrange_share_legend(
  ...,
  nrow = 1,
  ncol = length(list(...)),
  position = c("bottom", "right")
)

Arguments

...

Objects of class grob

nrow

Number of rows to align figures in.

ncol

Number of columns to align figures in.

position

Position where the legend will be printed. "bottom" or "right"

Value

A grob

Note

Source: http://rpubs.com/sjackman/grid_arrange_shared_legend

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# Example
mtmodified <- mtcars 
mutate_at(c("am", "vs"), as.factor)
mtmodified1 <- mtmodified 
mtmodified2 <- mtmodified 
grid_arrange_share_legend(mtmodified1, mtmodified2,
                          nrow = 2, ncol = 1, position = "bottom")

## End(Not run)

DeependraD/expdean documentation built on Nov. 25, 2019, 12:33 a.m.