How to find which elements related to which parts of venn diagram using calculate.overlap function in r?

后端 未结 1 668
温柔的废话
温柔的废话 2021-01-29 00:06

The output of calculate.overlap is not clear. There are some names for each position of venn diagram such as: $a1 , $a2 , ... It becomes so complicated when we draw it for five

1条回答
  •  温柔的废话
    2021-01-29 00:37

    There is an answer here. However, I do not claim to understand it. The general rule to order the regions in a Venn diagram is to use a binary representation of it. My nVennR package uses that representation and can give you a quick answer for any number of sets:

    > library(nVennR)
    > myV <- plotVenn(list("A"=c("a","b","c"), "B"=c("a","b","c","d"), "C"=c("a","c","d")), showPlot = F)
    > listVennRegions(myV)
    $`0, 1, 1 (B, C)`
    [1] "d"
    
    $`1, 1, 0 (A, B)`
    [1] "b"
    
    $`1, 1, 1 (A, B, C)`
    [1] "a" "c"
    
    > listVennRegions(myV, na.rm = F)
    $`0, 0, 0 ()`
    [1] NA
    
    $`0, 0, 1 (C)`
    [1] NA
    
    $`0, 1, 0 (B)`
    [1] NA
    
    $`0, 1, 1 (B, C)`
    [1] "d"
    
    $`1, 0, 0 (A)`
    [1] NA
    
    $`1, 0, 1 (A, C)`
    [1] NA
    
    $`1, 1, 0 (A, B)`
    [1] "b"
    
    $`1, 1, 1 (A, B, C)`
    [1] "a" "c"
    

    There is a vignette with more details on usage.

    0 讨论(0)
提交回复
热议问题