Reputation: 90
I want to create a linear Venn diagram in R, something like -
I know we can use GGVenn or VennDiagram in R but they only produce compact Venn diagrams like the following -
library(ggvenn)
ggvenn(list('S1' = LETTERS[1:10],'S2' = LETTERS[5:20],'S3' = LETTERS[15:26]), c("S1","S2","S3"))
My original data is also text, so the problem applies directly. Any ideas or solutions?
Upvotes: 2
Views: 212
Reputation: 52049
You can use the VennDiagram
package (I added a bit more to make it prettier):
library(VennDiagram)
x = list('S1' = LETTERS[1:10],'S2' = LETTERS[5:20],'S3' = LETTERS[15:26])
venn.diagram(x, "test.png",
category.names = c("S1","S2","S3"),
cat.fontface = "bold",
cat.default.pos = "outer",
fill = c("purple", "yellow", "green"),
cat.pos = c(-27, 27, 135),
cat.dist = c(0.055, 0.055, 0.055))
Upvotes: 2