View source: R/get.venn.partitions.R

get.venn.partitions | R Documentation |

Partitions a list into Venn regions.

get.venn.partitions(x, force.unique = TRUE, keep.elements = TRUE, hierarchical = FALSE)

`x` |
A list of vectors. |

`force.unique` |
A logical value. Should only unique values be considered? |

`keep.elements` |
A logical value. Should the elements in each region be returned? |

`hierarchical` |
A logical value. Changed the way overlapping elements are treated if force.unique is TRUE. |

A data frame with `length(x)`

columns and
`2 ^ length(x)`

rows. The first `length(x)`

columns are all
logical; see `make.truth.table`

for more details. There are three
additional columns:

- ..set..
A set theoretical desription of the Venn region. (Note that in some locales under Windows, the data.frame print method fails to correctly display the Unicode symbols for set union and set intersection. This is a bug in R, not this function.)

- ..values..
A vector of values contained in the Venn region. Not returned if keep.elements is FALSE.

- ..count..
An integer of the number of values in the Venn region.

If force.unique is FALSE, then there are two supported methods of grouping categories with duplicated elements in common.
If hierarchical is FALSE, then any common elements are gathered into a pool. So if
`x <- list(a = c(1,1,2,2,3,3), b=c(1,2,3,4,4,5), c=c(1,4))`

then `(b intersect c)/(a)`

would contain
three 4's. Since the 4's are pooled, `(b)/(a union c)`

contains no 4's.
If hierachical is TRUE, then `(b intersect c)/(a)`

would contain one 4.Then `(b)/(a union c)`

cotains one 4.

Richard Cotton.

`venn.diagram`

, `make.truth.table`

# Compare force.unique options x <- list(a = c(1, 1, 1, 2, 2, 3), b = c(2, 2, 2, 3, 4, 4)) get.venn.partitions(x) get.venn.partitions(x, force.unique = FALSE) # Figure 1D from ?venn.diagram xFig1d = list( I = c(1:60, 61:105, 106:140, 141:160, 166:175, 176:180, 181:205, 206:220), IV = c(531:605, 476:530, 336:375, 376:405, 181:205, 206:220, 166:175, 176:180), II = c(61:105, 106:140, 181:205, 206:220, 221:285, 286:335, 336:375, 376:405), III = c(406:475, 286:335, 106:140, 141:160, 166:175, 181:205, 336:375, 476:530) ) get.venn.partitions(xFig1d) grid.draw(VennDiagram::venn.diagram(x, NULL, disable.logging = TRUE))

VennDiagram documentation built on April 13, 2022, 1:06 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.