dat <- data.frame(
A = sample(c(TRUE, FALSE), size = 100, replace = TRUE),
B = sample(c(TRUE, TRUE, FALSE), size = 100, replace = TRUE),
gender = sample(c("Men", "Women"), size = 100, replace = TRUE),
nation = sample(c("Sweden", "Denmark"), size = 100, replace = TRUE)
)
e_grid <- eulerr(dat[, 1:2], by = dat[, 3:4])
plot(e_grid)
# We can provide custom titles for our diagrams
plot(e_grid, main = c("A", "B", "C", "D"))
# and use any options that plot.eulerr takes
plot(e_grid, polygon_args = list(col = "transparent"))
# It is also possible to change grid layout
plot(e_grid, mfrow = c(1, 4))
Run the code above in your browser using DataLab