A Google search using "r", "venn" and "diagram" revealed the following options:
- A package called VennDiagram
- A gplots that will plot Venn Diagrams
- An FAQ from UCLA which uses the Bioconductor package limma
- Some information on a package called vennerable.
- A nice StackOverflow question about proportional sizes and colours
With five ways to do something, which is the best? Well the short answer to that is the one that you like and thus the personal preference element which is key to R becomes the most important issue.
I have spent a little while trying to work out the differences between the various packages.
There is one key point: do you know the numbers for your Venn Diagram or do you want to find these out.
The package VennDiagram generally requires you to have all the numbers already. It produces nice diagrams and the examples include ways to generate high quality TIFF plots.
Here is an example of the four way Venn Diagram made with the example code:
I think it's pretty and I can appreciate how to change and add the information. This is the code (from :
# Reference four-set diagram
install.packages("VennDiagram")
library(VennDiagram)
venn.plot <- draw.quad.venn( area1 = 72,
area2 = 86,
area3 = 50,
area4 = 52,
n12 = 44,
n13 = 27,
n14 = 32,
n23 = 38,
n24 = 32,
n34 = 20,
n123 = 18,
n124 = 17,
n134 = 11,
n234 = 13,
n1234 = 6,
category = c("First", "Second", "Third", "Fourth"),
fill = c("orange", "red", "green", "blue"),
lty = "dashed",
cex = 2, cat.cex = 2, cat.col = c("orange", "red", "green", "blue") );
There is also an R package called "venn", it can draw diagrams up to 7 sets:
ReplyDeletehttps://cran.r-project.org/web/packages/venn/index.html
Find more venn diagram examples in the diagram community of Creately online diagramming and collaboration software. There are 100s of venn diagram examples and templates in the community to be used freely.
ReplyDelete