Description Details Author(s) Examples

Plot Venn diagram of 2-dimensional, 3-dimensional and 4-dimensional data with user-specified custom colors.

Package: | plotVenn |

Type: | Package |

Version: | 2.4 |

Date: | 2013-11-11 |

License: | GPL-2 |

The package is designed to be able to plot Venn diagrams for 2-d, 3-d and 4-d data. The uniqueness of it is in being able to specify custom colors for each part of the plot - including the crossovers.

If data needs to be shaped into appropriate format for it, createVennData() can be used. Given 3 columns of data and values by which to split the data, createVennData() splits it into 7 groups and counts values in each group or percent allocations. Notice: currently, it only can be used to generate 3-dimensional data.

Elliot Noma, Aliona Manvae

Maintainer: Elliot Noma <noma@garrettassetmanagement.com>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
data(survey, package = "MASS")
# For more info: ?MASS::survey
# Grouping students by Pulse, Height and Age
vennData <- createVennData(survey,
Cols = c("Pulse","Height","Age"),
Splits = c(75, 170, 20), ## Split Pulse at 75, split Height at 170, split Age at 20
Labels = NULL, ## Keep Labels NULL, as we wish to stick with Pulse, Height and Age titles.
type = c("percent")) ## generate data as percents
# Plot Venn diagram
# Notice:
# plotVenn is a generic function, which can be used to call plotVenn2d, plotVenn3d or plotVenn4d
plot.new()
plotVenn(vennData$x, vennData$labels)
##############################################
# Example of 4-dimensional data plotting, with default data
plot.new()
plotVenn4d(Title = "Example of 4-d Venn diagram")
``` |

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.