Dear all, I would like to draw a Venn plot for data represented by 6 variables (or sets). I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know an alternative to this package to draw this without having to calculate the area of all the possible combinations? Best wishes, Luigi library(venneuler) library(rJava) a<-c( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) b<-c( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) c<-c( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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cbind(a,b,c,d,e,f) plot(venneuler(data), main="test") [[alternative HTML version deleted]]
David Winsemius
2014-Feb-23 16:57 UTC
[R] Proportional Venn diagram 6 sets with labels with pkg:venneuler
On Feb 23, 2014, at 7:11 AM, Luigi Marongiu wrote:> Dear all,Dear Luigi; Please stop posting triplicate postings and also learn to post in plain text.> > I would like to draw a Venn plot for data represented by 6 variables (or > sets). I know how to do this using the package venneuler (which requires > rJava). However this package does not report the numbers of elements within > each class. > > Do you know an alternative to this package to draw this without having to > calculate the area of all the possible combinations? >If you having difficulty calculating the counts in categories, then consider this:> table(apply(data,1,function(x) paste(names(x[x==1]), collapse="_")))a_e a_e_f a_f b_c_e b_d b_d_f b_e b_e_f b_f c_d 2 1 11 1 1 1 5 9 3 1 c_e c_e_f c_f d_e_f e e_f f 10 6 9 2 17 25 1 To answer your direct question, I do not know how to get venneuler to do that. But the maintainer of the package reads rhelp, so even though you should have posed the question to him first, you should eventually get his eyes on the question. -- David.> Best wishes, > > Luigi > > > > library(venneuler) > > library(rJava) > > > > a<-c( 1, 1, 1, 1, 1, 1, > 1, > 1, 1, 1, 1, 1, 1, 1, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0) > > b<-c( 0, 0, 0, 0, 0, 0, > 0, > 0, 0, 0, 0, 0, 0, 0, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 0, > 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 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1, 1, 0, 0, 1, > 1, 1, 1, 0, 0, 0, 0, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 0) > > f<-c( 0, 0, 1, 1, 1, 1, > 1, 1, 1, 1, 1, 1, 1, > 1, 1, 0, 1, 1, 0, 1, > 1, 1, 0, 0, 1, 1, 0, > 1, 0, 1, 1, 1, 1, 0, > 0, 1, 0, 0, 0, 1, 1, > 1, 1, 1, 0, 1, 0, 1, > 0, 0, 1, 0, 1, 1, 1, > 0, 0, 0, 0, 1, 1, 1, > 1, 0, 1, 1, 1, 0, 1, > 0, 0, 1, 1, 0, 0, 1, > 1, 1, 0, 0, 0, 1, 1, > 0, 1, 1, 1, 1, 1, 1, > 0, 0, 1, 1, 1, 1, 1, > 0, 0, 1, 0, 1, 1, 1, > 1) > > > > data<-cbind(a,b,c,d,e,f) > > > > plot(venneuler(data), main="test") > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA