1

Inspection of the basic examples shows that the Vennerable input must a list of vectors here. So I do the following where I take there binary p-value matrices, and try to create a Venn diagram based on their common characteristics

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")

Fig. 1 Output wrong

enter image description here

Expected output: Vennerable Venn diagram of three circles

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
  ..@ 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"
  ..@ IntersectionSets:List of 8
  .. ..$ 000: NULL
  .. ..$ 100: NULL
  .. ..$ 010: NULL
  .. ..$ 110: NULL
  .. ..$ 001: NULL
  .. ..$ 101: NULL
  .. ..$ 011: NULL
  .. ..$ 111: logi [1:2] TRUE FALSE

R: 3.3.1
OS: Debian 8.5

zx8754
  • 52,746
  • 12
  • 114
  • 209
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
  • 1
    The intersect looks like it uses the TRUE/FALSE (0/1) as labels which I doubt that is what is intended. Try using `which` instead to get labels ie `which(p.mat[["p"]] < alpha)` etc – user20650 Nov 14 '16 at 19:50
  • @user20650 It seems to be correct. I made a wiki about it with a reference to you. Those big 0 areas are however strange. – Léo Léopold Hertz 준영 Nov 14 '16 at 19:56
  • 1
    yup doesn't look quite right. I don't have this installed so cant help but it looks like the size of the circles are scaled to the count but the intersects are not scaled: perhaps there is an argument for this? [second thought, in some cases id think, also scaling these would make it v. difficult (if not impossible) to arrange the sections) – user20650 Nov 14 '16 at 19:59
  • @user20650 Yes, it should be `plot(Vstem, doWeights = TRUE, type = "circles")` where particularly `doWeights = TRUE` but it does the reverse what it should do. – Léo Léopold Hertz 준영 Nov 14 '16 at 20:00

1 Answers1

1

user20650's answer in comment

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)
  )

Output

enter image description here

Ticket: #39 and #40

Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697