我想创建一个3路维恩图和一个更大的圆圈后面代表样本量。
双向文氏图示例,其中较大的圆圈表示样本量:
library("VennDiagram")
grid.newpage()
venn_AB <- draw.triple.venn(area1=count_A, area2=count_B, area3=count_sample, n12 = count_AB,
n23 =count_B, n13 =count_A, n123=count_AB,
category=c("A",
"B",
"Sample Size"),
col="Purple",fill=c("Red","Blue", "Yellow"), lty = "dashed", print.mode = c('raw', 'percent'))
维恩图(AB)
然而,当我将相同的技术应用于三向维恩图时:
grid.newpage()
venn_ABC = draw.quad.venn(area1=count_A, area2=count_B, area3=count_C,
area4 =count_sample, n12=count_AB, n23=count_BC, n13=count_AC,
n14= count_A,n24=count_B, n34=count_C, n123=count_ABC,
n124=count_AB, n234=count_BC, n134=count_AC, n1234=count_ABC,
category=c("A",
"B",
"C",
"Sample size"),
col="Purple",fill=c("Red","Blue","Orange","Yellow"),lty="dashed",print.mode = c('raw', 'percent'))
维恩图
我得到一个四向叶图。
预期文氏图
有没有办法在R中产生预期的结果?
1条答案
按热度按时间tmb3ates1#
任何广义维恩图生成器都应该这样做,即使结果在美学上不是很令人愉快。技巧是添加一个集合,该集合是其他集合的并集。例如,您可以尝试在
eulerr
中执行此操作。使用我自己的nVennR
包(https://github.com/vqf/nVennR),您可以执行以下操作:结果,
灰色的集合是宇宙,下面的圆圈表示不在集合a,B或c中的元素(在示例中,'r','s'和't ')。