简体   繁体   中英

How can get the value of the public part of the venn diagram which drawn by venn-package in R

Now I am using venn package in R to draw venn diagram and I succeeded.But I also want to get the value of the public part of the venn diagram.Although I have queried the official document,I cannot find any function to solve my problem.By the way,I need to draw a diagram with 6 sets,so you cannot use vennDiagram package.I hope to get your help.

library(venn)
venn(list("A" = c(1,2,3),"B" = c(3,4,5),"C" = c(1,2,3,4,5,6)))

在此输入图像描述

For the lengths of the intersections you can try:

library(venn)

v <- venn(list("A" = c(1,2,3),"B" = c(3,4,5),"C" = c(1,2,3,4,5,6)))
lengths(attr(v, "intersections"))

C   B:C   A:C A:B:C 
1     2     2     1 

For the values that intersect you can do:

attr(v, "intersections")

$C
[1] 6

$`B:C`
[1] 4 5

$`A:C`
[1] 1 2

$`A:B:C`
[1] 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM