eulerr在线版:http://eulerr.co/
R package地址:https://cran.r-project.org/web/packages/eulerr/index.html
eulerr包优势:
- 圆形面积与数值成正比
- 绘图参数调节便利
安装
install.packages('eulerr')
使用
官方教程:https://cran.r-project.org/web/packages/eulerr/vignettes/gallery.html
样图
library(eulerr)
Venn <- function(lst.A, lst.B, lst.C){
A = lst.A %>% length()
B = lst.B %>% length()
C = lst.C %>% length()
AB = intersect(lst.A, lst.B) %>% length()
AC = intersect(lst.A, lst.C) %>% length()
BC = intersect(lst.B, lst.C) %>% length()
ABC = intersect(lst.A, lst.B) %>% intersect(., lst.C) %>% length()
euler(c(
"A" = A - AB - AC + ABC,
"B" = B - AB - BC + ABC,
"C" = C - AC - BC + ABC,
"A&B" = AB - ABC,
"A&C" = AC - ABC,
"B&C" = BC - ABC,
"A&B&C" = ABC
)) %>% return()
}
vd <- Venn(
lst.A <- d[method=='DI']$bin,
lst.B <- dt[method=='IS']$bin,
lst.C <- dt[method=='TopDom']$bin
)
plot(vd,
labels = list(
labels = c('DI', 'IS', 'TopDom'),
col = "gray20", font = 2
),
edges = list(col="gray60", lex=1),
fills = list(fill = c("#297CA0", "#BBBBBB", "#E9EA77"), alpha = 0.6),
quantities = list(cex=.8, col='gray20')
)