This package produces Venn diagrams for up to seven sets, using any Boolean union of set intersections.
Install the stable version from CRAN:
A simple Venn diagram with 3 sets
With a vector of counts: 1 for “000”, 2 for “001” etc.
Display the first whole set
Same with
An equivalent command, from the union of all intersections
Same with
Adding the labels for the intersections
Using different parameters for the borders
Using ellipses
A 5 sets Venn diagram
A 5 sets Venn diagram using ellipses
A 5 sets Venn diagram with intersection labels
And a predefined color style
A union of two sets
Same with
With different colors
Same using SOP - sum of products notation
Same colors for the borders
A 6 sets diagram
Seven sets “Adelaide”
Artistic version
Without all borders
venn(c("1000000", "0100000", "0010000", "0001000",
"0000100", "0000010", "0000001", "1111111"),
borders = FALSE)
Using SOP - sum of products notation
The input can be a list
set.seed(12345)
x <- list(First = 1:20, Second = 10:30, Third = sample(25:50, 15))
venn(x, ilabels = "counts")
Or a dataframe
set.seed(12345)
x <- as.data.frame(matrix(sample(0:1, 150, replace = TRUE), ncol = 5))
venn(x, ilabels = "counts")
Using ggplot2 graphics
Increasing the border size
With dashed lines
Venn diagrams for QCA objects
Custom labels for intersections
pCVF <- minimize(obj, include = "?")
venn(pCVF$solution[[1]], zcol = "#ffdd77, #bb2020, #1188cc")
cases <- paste(c("HungariansRom", "CatholicsNIreland", "AlbaniansFYROM",
"RussiansEstonia"), collapse = "\n")
coords <- unlist(getCentroid(getZones(pCVF$solution[[1]][2])))
text(coords[1], coords[2], labels = cases, cex = 0.85)