Learn R Programming

RVenn (version 1.1.0)

ggvenn,Venn-method: Draw the Venn diagram.

Description

Draw the Venn diagram for 2 or 3 sets.

Usage

# S4 method for Venn
ggvenn(venn = "Venn", slice = "all",
  fill = c("gold", "dodgerblue3", "deeppink"), alpha = 0.5,
  thickness = 1.5)

Arguments

venn

(Required) A Venn object.

slice

(Optional) The names or the indices of the sets of interest. Default is "all", which is for the cases the Venn object only contains 2 or 3 sets. If you have 4 or more sets, this argument is required.

fill

(Optional) Fill color of the sets.

alpha

(Optional) Opacity of the fill colors. Default is 0.5 in the range of (0, 0.5).

thickness

(Optional) Stroke size of the sets.

Value

The function returns the plot in ggplot2 style.

Details

This function is based on the packages 'ggplot2' and 'ggforce.' It has been designed for 2 or 3 sets because Venn diagrams are terrible for showing the interactions of 4 or more sets. If you need to visualize such interactions, consider using setmap.

Examples

Run this code
# NOT RUN {
venn = Venn(list(letters[1:10], letters[3:12], letters[6:15]))
ggvenn(venn)
ggvenn(venn, slice = c(1, 2), thickness = 0, alpha = 0.3)
# }

Run the code above in your browser using DataLab