# getZones: Calculate the union(s) of set intersections. In venn: Draw Venn Diagrams

## Description

This function uses a metacommand to calculate the shape of a specific zone or a list of zones.

## Usage

 `1` ```getZones(area, snames, ellipse = FALSE) ```

## Arguments

 `area` A chgaracter expression written in sum of products form. `snames` A string containing the sets' names, separated by commas. `ellipse` Logical, get the zones from the shape of an ellipse, where possible

## Details

A SOP ("sum of products") is also known as a DNF ("disjunctive normal form"), or in other words a "union of intersections", for example `A*D + B*c`.

The same expression can be written in curly brackets notation: `A{1}*D{1} + B{1}*C{0}`.

The expression `B{1}*C{0}` can also be written in a pseudo-language, as "-10-" (assuming there are only four sets).

A "zone" is a union of set intersections. There are exactly `2^k` intersections in a Venn diagram, where `k` is the number of sets. To highlight an entire set, we need a union of all possible intersections which form that set.

The argument `ellipse` retrieves the data from the shape of an ellipse, and it only works with 4 and 5 sets.

## Value

A list of self-enclosed polygons, for each independent zone.

## Examples

 ``` 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``` ```venn(3) area <- getZones("A", snames = "A, B, C") # a list of length 1 polygon(area[], col="lightblue") # The very same result is obtained with: zone <- getZones("1--") # for 5 sets, the content of the 5th set but not in the first set is a # list of two zones venn(5) zones <- getZones("0---1") # this time a list of length 2 # (re)coloring the first zone (union) polygon(zones[], col="lightblue") # and the second zone (union) polygon(zones[], col="lightblue") ```

venn documentation built on March 16, 2021, 1:08 a.m.