I would like to put together these three venn diagrams. So when I print them, they appear in the same page
library(VennDiagram)
df1 <- data.frame(G1=sample(1:100, 10), G2=sample(1:100, 10),
G3=sample(1:100, 10), G4=sample(1:100, 10))
venn.plot.df1 <- venn.diagram(x = as.list(df1), filename = NULL,
cat.col = c( "black", "red", "green3", "blue" ),
fill=c("black", "red", "green3", "blue"))
grid.draw(venn.plot.df1)
df2 <- data.frame(G1=sample(1:100, 10), G2=sample(1:100, 10),
G3=sample(1:100, 10), G4=sample(1:100, 10))
venn.plot.df2 <- venn.diagram(x = as.list(df2), filename = NULL,
cat.col = c( "black", "red", "green3", "blue" ),
fill=c("black", "red", "green3", "blue"))
grid.draw(venn.plot.df2)
df3 <- data.frame(G1=sample(1:100, 10), G2=sample(1:100, 10),
G3=sample(1:100, 10), G4=sample(1:100, 10))
venn.plot.df3 <- venn.diagram(x = as.list(df3), filename = NULL,
cat.col = c( "black", "red", "green3", "blue" ),
fill=c("black", "red", "green3", "blue"))
grid.draw(venn.plot.df3)
thanks!
To solve a Venn diagram with 3 circles, start by entering the number of items in common to all three sets of data. Then enter the remaining number of items in the overlapping region of each pair of sets. Enter the remaining number of items in each individual set. Finally, use any known totals to find missing numbers.
The venn.diagram function is returning gList objects. It seems that the way to arrange them is to first convert them to gTree objects and then plot with the grid.arrange function:
library(gridExtra)
grid.arrange(gTree(children=venn.plot.df1), gTree(children=venn.plot.df2),
gTree(children=venn.plot.df3), ncol=3)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With