If possible, generates exactly area-proportional Euler diagrams using numerical optimization. A Euler diagram is a generalization of a Venn diagram, relaxing the criterion that all interactions need to be represented. Euler diagrams can be fit with both ellipses and circles from a wide range of inputs and can be visualized in numerous ways.
eulerr generates area-proportional euler diagrams that display set relationships (intersections, unions, and disjoints) with circles. Euler diagrams are Venn diagrams without the requirement that all set interactions be present (whether they are empty or not). That is, depending on input, eulerr will sometimes produce Venn diagrams but sometimes not.
With three or more sets intersecting, exact euler diagrams are often impossible. For such cases eulerr attempts to provide the best approximation possible by numerically tuning the circles' positions and radiuses so that the sum of squared errors is minimized.
When solutions are approximate, residuals and error statistics are provided to assess whether the resulting diagram can be trusted.
The CRAN version can be installed by running
The development version can be installed by running
library(eulerr)sets <- c("A" = 10, "B" = 9, "C" = 4,"A&B" = 2, "A&C" = 3, "B&C" = 3,"A&B&C" = 2)set.seed(1)fit <- eulerr(sets)
We can inspect the solution
fit #> A 10 9.999 0.001 0.000#> B 9 8.999 0.001 0.000#> C 4 4.013 -0.013 0.000#> A&B 2 2.026 -0.026 0.001#> A&C 3 2.994 0.006 0.000#> B&C 3 2.994 0.006 0.000#> A&B&C 2 1.975 0.025 0.001#>#> diagError: 0.001#> stress: 0
and plot it using
Please see the introductory vignette for usage details.
eulerr is open source software, licensed under GPL-3.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
eulerr. The result is a list of euler diagrams that can be plotted in a grid arrangement via a new plot method.
plot.eulerrwith a default that produces symmetric margins.
stressstatistic from venneuler.