Displaying 1 result from an estimated 1 matches for "venn2".
Did you mean:
venn
2010 Feb 23
1
How to change a venn command into a named object that can be plotted like a lattice object
.... I would like to name it and then plot at will.
I thought to convert the whole thing to a PostScript file then get it back into R via grImport, but surely (please!) there must be a less roundabout way to do this.
Any help is appreciated.
Here is my code:
# Wrapper function to draw Venn diagram
Venn2 <- function(set1, set2, names, title,...){
stopifnot( length(names) == 2)
# Form universe as union of both sets
universe <- sort( unique( c(set1, set2) ) )
Counts <- matrix(0, nrow=length(universe), ncol=2)
colnames(Counts) <- names
for (i in 1:length(universe)) {
Count...