# A simple Venn diagram with 3 sets
venn(3)
# display the first whole set
venn("1--")
# an equivalent command
venn("100 + 110 + 101 + 111")
# another equivalent command
venn(c("100", "110", "101", "111"))
# adding the labels for the intersections
venn("1--", ilab = TRUE)
# using different parameters for the borders
venn(4, lty = 5, col = "navyblue")
# using ellipses
venn(4, lty = 5, col = "navyblue", ellipse = TRUE)
# a 5 sets Venn diagram
venn(5)
# a 5 sets Venn diagram using ellipses
venn(5, ellipse = TRUE)
# a 5 sets Venn diagram with intersection labels
venn(5, ilab = TRUE)
# and a predefined color style
venn(5, ilab = TRUE, zcolor = "style")
# a union of two sets
venn("1---- + ----1")
# with different colors
venn("1---- + ----1", zcol = c("red", "blue"))
# same colors for the borders
venn("1---- + ----1", zcol = c("red", "blue"), col = c("red", "blue"))
# 6 sets diagram
venn(6)
# 7 sets "Adelaide"
venn(7)
# artistic version
venn(c("1000000", "0100000", "0010000", "0001000",
"0000100", "0000010", "0000001", "1111111"))
# when x is a list
set.seed(12345)
x <- list(First = 1:20, Second = 10:30, Third = sample(25:50, 15))
venn(x)
# when x is a dataframe
set.seed(12345)
x <- as.data.frame(matrix(sample(0:1, 150, replace=TRUE), ncol=5))
venn(x)
# using disjunctive normal form notation
venn("A + Bc", snames = LETTERS[1:4])
# the union of two sets, example from above
venn("A + E", snames = LETTERS[1:5], zcol = c("red", "blue"))
# produce Venn diagrams for QCA objects
library(QCA)
data(d.jobsecurity)
obj <- truthTable(d.jobsecurity, outcome = "JSR", conditions = "S,C,L,R,P",
incl.cut1 = 0.9, incl.cut0 = 0.5)
venn(obj)
# to set transparency function of inclusion scores
venn(obj, transparency = obj$tt$incl)Run the code above in your browser using DataLab