R

时间:2018-05-19 23:01:14

标签: r plot venn-diagram

我试图使用R中的eulerr包绘制维恩图。

library(eulerr)

vd <- euler(c("gen"=7,"RC"=1,"PP"=2,"Mixed"=5,"None"=12,"gen&PP"=30,
          "gen&PP&RC"=6,"PP&RC"=2,"gen&RC"=6),
        shape="circle");

检查我得到的vd对象的值

                     original fitted residuals regionError
gen                         7  7.690    -0.690       0.008
RC                          1  1.482    -0.482       0.006
PP                          2  2.327    -0.327       0.004
Mixed                       5  5.172    -0.172       0.001
None                       12 12.412    -0.412       0.003
gen&RC                      6  5.641     0.359       0.006
gen&PP                     30 30.942    -0.942       0.007
gen&Mixed                   0  0.000     0.000       0.000
gen&None                    0  0.000     0.000       0.000
RC&PP                       2  0.000     2.000       0.028
RC&Mixed                    0  0.000     0.000       0.000
RC&None                     0  0.000     0.000       0.000
PP&Mixed                    0  0.000     0.000       0.000
PP&None                     0  0.000     0.000       0.000
Mixed&None                  0  0.000     0.000       0.000
gen&RC&PP                   6  6.387    -0.387       0.004
gen&RC&Mixed                0  0.000     0.000       0.000
gen&RC&None                 0  0.000     0.000       0.000
gen&PP&Mixed                0  0.000     0.000       0.000
gen&PP&None                 0  0.000     0.000       0.000
gen&Mixed&None              0  0.000     0.000       0.000
RC&PP&Mixed                 0  0.000     0.000       0.000
RC&PP&None                  0  0.000     0.000       0.000
RC&Mixed&None               0  0.000     0.000       0.000
PP&Mixed&None               0  0.000     0.000       0.000
gen&RC&PP&Mixed             0  0.000     0.000       0.000
gen&RC&PP&None              0  0.000     0.000       0.000
gen&RC&Mixed&None           0  0.000     0.000       0.000
gen&PP&Mixed&None           0  0.000     0.000       0.000
RC&PP&Mixed&None            0  0.000     0.000       0.000
gen&RC&PP&Mixed&None        0  0.000     0.000       0.000

diagError: 0.028 
stress:    0.004 

因此,RC&PP的拟合值为0.000,它不会出现在最终的绘图结果中。是否可以修改此值,以便交点出现在图表中?

1 个答案:

答案 0 :(得分:0)

该问题类似于echoCancellation constraint。正如约翰·拉森(Johan Larsson)所说,nVennR算法很难解决这类问题。如果您想尝试> library(nVennR) > myV <- createVennObj(nSets = 5, sNames = c("gen","RC","PP","Mixed","None")) > myV <- setVennRegion(myV, c("gen"), 7) > myV <- setVennRegion(myV, c("RC"), 1) > myV <- setVennRegion(myV, c("PP"), 2) > myV <- setVennRegion(myV, c("Mixed"), 5) > myV <- setVennRegion(myV, c("None"), 12) > myV <- setVennRegion(myV, c("gen", "PP"), 30) > myV <- setVennRegion(myV, c("gen", "PP", "RC"), 6) > myV <- setVennRegion(myV, c("PP", "RC"), 2) > myV <- setVennRegion(myV, c("gen", "RC"), 6) > myV <- plotVenn(nVennObj = myV) > myV <- plotVenn(nVennObj = myV) > myV <- plotVenn(nVennObj = myV) ,可以:

{{1}}

故意重复最后一个命令以压缩结果:

this one

您可以检查Euler diagram以获得更多信息。