Description Usage Arguments Details Value Methods (by class) References See Also Examples
Fit Euler diagrams (a generalization of Venn diagrams) using numerical optimization to find exact or approximate solutions to a specification of set relationships. The shape of the diagram may be a circle or an ellipse.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  euler(combinations, ...)
## Default S3 method:
euler(
combinations,
input = c("disjoint", "union"),
shape = c("circle", "ellipse"),
control = list(),
...
)
## S3 method for class 'data.frame'
euler(
combinations,
weights = NULL,
by = NULL,
sep = "_",
factor_names = TRUE,
...
)
## S3 method for class 'matrix'
euler(combinations, ...)
## S3 method for class 'table'
euler(combinations, ...)
## S3 method for class 'list'
euler(combinations, ...)

combinations 
set relationships as a named numeric vector, matrix, or data.frame (see methods (by class)) 
... 
arguments passed down to other methods 
input 
type of input: disjoint identities
( 
shape 
geometric shape used in the diagram 
control 
a list of control parameters.

weights 
a numeric vector of weights of the same length as
the number of rows in 
by 
a factor or character matrix to be used in 
sep 
a character to use to separate the dummycoded factors if there are factor or character vectors in 'combinations'. 
factor_names 
whether to include factor names when constructing dummy codes 
If the input is a matrix or data frame and argument by
is specified,
the function returns a list of euler diagrams.
The function minimizes the residual sums of squares,
∑ (A_i  ω_i)^2,
where ω_i the size of the ith disjoint subset, and A_i the corresponding area in the diagram, that is, the unique contribution to the total area from this overlap.
euler()
also returns stress
(from venneuler), as well as
diagError
, and regionError
from eulerAPE.
The stress statistic is computed as
∑ (A_i  βω_i)^2 / ∑ A_i^2,
where
β = ∑ A_iω_i / ∑ ω_i^2.
regionError
is computed as
maxA_i / ∑ A  ω_i / ∑ ω.
diagError
is simply the maximum of regionError.
A list object of class 'euler'
with the following parameters.
ellipses 
a matrix of 
original.values 
set relationships in the input 
fitted.values 
set relationships in the solution 
residuals 
residuals 
regionError 
the difference in percentage points between each disjoint subset in the input and the respective area in the output 
diagError 
the largest 
stress 
normalized residual sums of squares 
default
: a named numeric vector, with
combinations separated by an ampersand, for instance A&B = 10
.
Missing combinations are treated as being 0.
data.frame
: a data.frame
of logicals, binary integers, or
factors.
matrix
: a matrix that can be converted to a data.frame of logicals
(as in the description above) via base::as.data.frame.matrix()
.
table
: A table with max(dim(x)) < 3
.
list
: a list of vectors, each vector giving the contents of
that set (with no duplicates). Vectors in the list must be named.
Wilkinson L. Exact and Approximate AreaProportional Circular Venn and Euler Diagrams. IEEE Transactions on Visualization and Computer Graphics (Internet). 2012 Feb (cited 2016 Apr 9);18(2):32131. Available from: doi: 10.1109/TVCG.2011.56
Micallef L, Rodgers P. eulerAPE: Drawing AreaProportional 3Venn Diagrams Using Ellipses. PLOS ONE (Internet). 2014 Jul (cited 2016 Dec 10);9(7):e101717. Available from: doi: 10.1371/journal.pone.0101717
plot.euler()
, print.euler()
, eulerr_options()
, venn()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37  # Fit a diagram with circles
combo < c(A = 2, B = 2, C = 2, "A&B" = 1, "A&C" = 1, "B&C" = 1)
fit1 < euler(combo)
# Investigate the fit
fit1
# Refit using ellipses instead
fit2 < euler(combo, shape = "ellipse")
# Investigate the fit again (which is now exact)
fit2
# Plot it
plot(fit2)
# A set with no perfect solution
euler(c("a" = 3491, "b" = 3409, "c" = 3503,
"a&b" = 120, "a&c" = 114, "b&c" = 132,
"a&b&c" = 50))
# Using grouping via the 'by' argument through the data.frame method
euler(fruits, by = list(sex, age))
# Using the matrix method
euler(organisms)
# Using weights
euler(organisms, weights = c(10, 20, 5, 4, 8, 9, 2))
# The table method
euler(pain, factor_names = FALSE)
# A euler diagram from a list of sample spaces (the list method)
euler(plants[c("erigenia", "solanum", "cynodon")])

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.