Skip to content

Instantly share code, notes, and snippets.

@informationsea
Created January 29, 2016 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save informationsea/6290eb9edc1fb2bbd791 to your computer and use it in GitHub Desktop.
Save informationsea/6290eb9edc1fb2bbd791 to your computer and use it in GitHub Desktop.
Venn Diagram Helper Function
library(VennDiagram)
venn.quad <- function(g1, g2, g3, g4, category=rep("", 4)) {
draw.quad.venn(length(g1), length(g2), length(g3), length(g4),
length(intersect(g1, g2)), length(intersect(g1, g3)), length(intersect(g1, g4)), length(intersect(g2, g3)), length(intersect(g2, g4)), length(intersect(g3, g4)),
length(intersect(g1, intersect(g2, g3))), length(intersect(g1, intersect(g2, g4))), length(intersect(g1, intersect(g3, g4))), length(intersect(g2, intersect(g3, g4))),
length(intersect(intersect(g1, g2), intersect(g3, g4))),
category=category)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment