# 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")
# a 5 sets Venn diagram
venn(5)
# a union of two sets
venn("1---- + ----1")
# with different colors
venn("1---- + ----1", zcol = c("red", "blue"), transp = 0.3)
# 6 sets diagram
venn(6)
# 7 sets "Adelaide"
venn(7)
# first set colored
venn("1------", ilab = TRUE)
# 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)
Run the code above in your browser using DataLab