Generate area-proportional Euler diagrams using numerical optimization. An Euler diagram is a generalization of a Venn diagram, relaxing the criterion that all interactions need to be represented. Diagrams may be fit with ellipses and circles via 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 or ellipses. Euler diagrams are Venn diagrams without the requirement that all set interactions be present (whether they are empty or not), which means that, depending on input, eulerr sometimes produces Venn diagrams and sometimes not.
With three or more sets intersecting, exact Euler diagrams are often impossible. For such cases eulerr attempts to provide a good approximation by numerically tuning the parameters of the ellipses or circles to minimize the error in the resulting diagram. Residuals and goodness of fit statistics are provided to assess whether the resulting diagram can be trusted.
eulerr is also available as a shiny app hosted at jolars.co/eulerr.
library(eulerr)# From Wilkinson 2012fit <- euler(c("A" = 4, "B" = 6, "C" = 3, "D" = 2, "E" = 7, "F" = 3,"A&B" = 2, "A&F" = 2, "B&C" = 2, "B&D" = 1,"B&F" = 2, "C&D" = 1, "D&E" = 1, "E&F" = 1,"A&B&F" = 1, "B&C&D" = 1),shape = "ellipse")
We can inspect the goodness-of-fit metrics diagError and stress for the solution,
fit$stress#>  3.762385e-12fit$diagError#>  3.944839e-07
and plot it
eulerr is open source software, licensed under GPL-3.
eulerr uses semantic versioning.
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.
plot.euler()has been rewritten completely from scratch, now using a custom grid-based implementation rather than lattice. As a result, all
label()have been deprecated as well as arguments
panel. The method for plotting diagrams has also changed---rather than overlaying shapes on top of each other, the diagram is now split into separate polygons using the polyclip package. Instead of relying on semi-transparent fills, the colors of the fills are now blended in the CIELab color space (#16).
eulerr_options()have been provided in order to set default grahical parameters for the diagrams.
plot.euler()are now defunct.
euler()now always returns ellipse-based parameters with columns
phi, regardless of which shape is used. This item was previously named "coefficients", but it now called "ellipses" instead and a custom
coef.euler()method has been added to make cure that
plot.euler()now works correctly (#20).
labelis now a proper generic with an appropriate method (
countsargument in one of the vignettes.
auto.key = TRUEand labels were not in alphabetic order. (#15)
shape = "ellipse"in
euler(). This functionality accompanies an overhaul of the innards of the function.
stats::optim(..., method = "L-BFGS-B")to
GenSA::GenSA()when the fit from
nlminb()isn't good enough, by default for 3 sets and ellipses, but this behavior can be controlled via a new argument
regionErrormetrics have been changed from
region_errorto reflect the original names.
label()function has been added to extract locations for the overlaps for third party plotting (#10).
panel.euler.labels()have been deprecated in favor of the more appropriate
plot.euler()that was deprecated in v2.0.0 has been made defunct.
eulerr()has been replaced with
euler()(see update 1.1.0) and made defunct.
euler.list()produces diagrams from a list of sample spaces.
euler.table()produces diagrams from a
tableobject, as long as there are no dimensions with values greater than 2.
plot.euler()has been rewritten (again) from the ground up to better match other high-level functions from lattice. This change is intended to be as smooth as possible and should not make much of a difference to most users.
plot.euler()have been made defunct.
plot.euler()handles conflicting arguments better.
eulerrnow use registration.
euler()now allows single sets (#9).
plot.euler()now use a bold fontface by default in order to distinguish them from the typeface used for counts.
plot.euler()has been deprecated and replaced with
auto.key. Notice that using
keydoes not throw a warning since the argument is used in
fill_opacityis softly deprecated and has been replaced with
fill_alphafor consistency with other lattice functions.
plot.euler()works again (#7).
eulerr()and its related methods been deprecated and are being replaced by
euler(), which takes slightly different input. Notably, the default is now to provide input in the form of disjoint class combinations, rather than unions. This is partly to make the function a drop-in replacement for
plot.euler()has been completely revamped, now interfacing
xyplot()from lattice. As a result, arguments
text_argshave been deprecated.
plot.eulerr, which intersections and complements with counts from the original set specificiation (#6).
plot.eulerrthat prints a legend next to the diagram.
costand now forces the function to use sums of squares, which is more or less equivalent to the cost function from
plot.euler()now chooses colors adapted to color vision deficiency (deuteranopia). With increasingly large numbers of sets, this adaptation is relaxed to make sure that colors are kept visually distinct.
optim(method = "Nelder-Mead")for its final optimization.
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.