geom_venn: create a venn diagram in ggplot2

Description Usage Arguments Details Value Examples

View source: R/geom_venn.R

Description

Imports: ggplot2

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
geom_venn(
  setlist,
  xlim = c(0, 1),
  ylim = c(0, 1),
  numbersize = 4,
  numbercolor = "black",
  textsize = 4,
  textcolor = "black",
  fillCol = TRUE,
  borderCol = FALSE,
  fixedCoords = TRUE,
  ...
)

Arguments

setlist

list of character vectors.

xlim

vector with 2 numbers, x axis limits for the venn diagram.

ylim

vector with 2 numbers, y axis limits for the venn diagram.

textsize

integer, defining the text size of the numbers in the graph.

fillCol

boolean, should the fill color indicate the list items?

borderCol

boolean, should the border color indicate the list items?

fixedCoords

boolean, should coord_fixed be applied? If TRUE, makes the graph into a square.

...

Other arguments passed on to layer(). These are often aesthetics, used to set an aesthetic to a fixed value, like colour = "red" or size = 3. They may also be parameters to the paired geom/stat.

Details

the function uses geom_polygon for the dendrogram, so ... takes all arguements that geom_polygon would also take, such as color, size, alpha, etc.

Value

a ggplot2 layer objects (geom_polyon for the venn diagram) that can directly be added to a ggplot2 object

Examples

1
2
3
4
5
6
7
8
9
library(ggvenn)
library(ggplot2)

set1 <- rownames(subset(mtcars, mpg>18))
set2 <- rownames(subset(mtcars, qsec>18))
set3 <- rownames(subset(mtcars, cyl<5))
carset <- list(highMpg=set1, highQsec=set2, lowCyl=set3)

ggplot2::ggplot() + geom_venn(carset)

NicolasH2/ggvenn documentation built on Dec. 17, 2021, 5:24 a.m.