I have the following Script for R - VennDiagram, where the sets are filled automatically and where sets (like here b1) may be empty:
suppressPackageStartupMessages(library(VennDiagram))
b1 <- c()
b2 <- c(1,2)
base_data <- list(b1, b2)
names(base_data) <- c("b1", "b2")
pdf(file="out.pdf",7,7)
p1 <- venn.diagram(base_data,filename = NULL,euler.d=False,cex=2,cat.cex=2)
grid.draw(p1)
dev.off()
R than gives me the following error:
Error in x[[i]] : subscript out of bounds
Calls: venn.diagram -> unique
Execution halted
I tested several variants and it is always thrown, as long as in the created list an empty set is in front of another set.
I know that for other R-Venn libraries it is even possible to pass 4 empty sets and resolve a Venn diagram filled with zero in each section.
So, is VennDiagram able to build a diagram out of empty sets, too? And if yes, what am I doing wrong?
Thank you in advance!
Julia