2016-11-14 64 views
1

基本示例的检查显示Vennerable输入必须包含一个向量列表here。 所以我做的,我需要有二进制p值矩阵,并尝试基于他们的共同特点如何从二元矩阵做R Vennerable Venn图?

library("Vennerable") 
library('limma') # vennCounts, vennDiagram 
library("psych") 

ids <- seq(1,11) 
M.cor <- cor(mtcars) 
colnames(M.cor) <- ids 
rownames(M.cor) <- ids 

p.mat <- psych::corr.test(M.cor, adjust = "none", ci = F) 

alpha <- 0.000000005 

lista <- list(
    as.vector(p.mat[["p"]] < alpha), 
    as.vector(p.mat[["r"]] < alpha), 
    as.vector(p.mat[["t"]] < alpha) 
) 
# List of 3 vectors  

Vstem <- Venn(lista) 

plot(Vstem, doWeights = TRUE, type = "circles") 

图1输出错误

enter image description here

预计将创造一个维恩图如下输出:三个圆

STOUT

List of 3 
$ : logi [1:121] TRUE TRUE TRUE FALSE FALSE FALSE ... 
$ : logi [1:121] FALSE TRUE TRUE TRUE FALSE TRUE ... 
$ : logi [1:121] FALSE TRUE TRUE TRUE FALSE TRUE ... 
Formal class 'Venn' [package "Vennerable"] with 2 slots 
    [email protected] IndicatorWeight : int [1:8, 1:4] 0 1 0 1 0 1 0 1 0 0 ... 
    .. ..- attr(*, "dimnames")=List of 2 
    .. .. ..$ : chr [1:8] "000" "100" "010" "110" ... 
    .. .. ..$ : chr [1:4] "1" "2" "3" ".Weight" 
    [email protected] IntersectionSets:List of 8 
    .. ..$ 000: NULL 
    .. ..$ 100: NULL 
    .. ..$ 010: NULL 
    .. ..$ 110: NULL 
    .. ..$ 001: NULL 
    .. ..$ 101: NULL 
    .. ..$ 011: NULL 
    .. ..$ 111: logi [1:2] TRUE FALSE 
的Vennerable维恩图

R:3.3.1
OS:Debian的8.5

+1

相交外观喜欢它使用TRUE/FALSE(0/1)作为标签,我怀疑这是什么意图。尝试使用'which'代替标签,例如'which(p.mat [[“p”]] user20650

+0

@ user20650这似乎是正确的。我提到了一个关于它的wiki。然而,那些大的0区却很奇怪。 –

+1

是不正确的。我没有这样安装,所以不能帮助,但它看起来像圆的大小缩放到计数,但相交不缩放:也许有这样的论点? [第二个想法,在某些情况下,编号认为,也缩放这些将使它很难(如果不是不可能的话)安排部分) – user20650

回答

1

在评论user20650的回答

lista <- list(
    which(p.mat[["p"]] < alpha), #as.vector(p.mat[["p"]] < alpha), 
    which(p.mat[["r"]] < alpha), #as.vector(p.mat[["r"]] < alpha), 
    which(p.mat[["t"]] < alpha) #as.vector(p.mat[["t"]] < alpha) 
) 

输出

enter image description here

票:#39#40