I am trying to graph a proportional Venn diagram with eurlerr, however the final graph is missing the A&C intersection.
A = 9, B = 2, C = 0, “A&B” = 28, “B&C” = 4, “A&C” = 1, “A&B&C” = 25
Does anyone know how to fix this issue?
I tried both in R and the web page. And using both circle and elipse. On the web page it includes the A&C unteraction at first but looses it once all interactions data is included.
This is the code:
library(eulerr)
# Create a named vector with the sizes of each subset and intersection
sizes <- c(A = 9, B = 2, C = 0, "A&B" = 28, "B&C" = 4, "A&C" = 1, "A&B&C" = 25)
# Create a proportional Venn diagram
plot(euler(sizes),
fills = c("yellow", "skyblue", "deeppink"))
Thanks,
Paula
user26384605 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
0
Using ellipse works fine for your data, we can use residuals error plots to check, it shows which overlaps are under/over-represented, 0 meaning exact:
library(gridExtra)
fit1 <- euler(sizes)
fit2 <- euler(sizes, shape = "ellipse")
grid.arrange(plot(fit1, fills = c("yellow", "skyblue", "deeppink")),
plot(fit2, fills = c("yellow", "skyblue", "deeppink")),
error_plot(fit1),
error_plot(fit2),
nrow = 2)
sizes <- c(A = 9, B = 2, C = 0,
"A&B" = 28, "B&C" = 4, "A&C" = 1,
"A&B&C" = 25)
eusizes <- euler(sizes)
eusizes
original fitted residuals regionError
A 9 9.045 -0.045 0.001
B 2 2.409 -0.409 0.006
C 0 0.490 -0.490 0.007
A&B 28 27.965 0.035 0.002
A&C 1 0.000 1.000 0.014
B&C 4 3.718 0.282 0.004
A&B&C 25 25.015 -0.015 0.002
diagError: 0.014
stress: 0.001
The fit or “A&C” is zero, so you don’t see it in the plot.
1