js229 / Vennerable

Vennerable provides Venn diagrams in R. It displays Venn and Euler diagrams for up to 9 different sets and using a variety of geometries. It allows the display of area-weighted Venn diagrams and allows fine graphical control over the result.
90 stars 39 forks source link

Why Vennerable Fail if Venn has points outside circles? #40

Open sami10007 opened 7 years ago

sami10007 commented 7 years ago

I have experienced strange errors with Vennerable with data which has points outside circles, see Fig. (1-2). The doWeights = TRUE also fails here.

Fig. 1 Left-hand-side figure shows the things outside circles, Fig. 2 Application of same data in Vennerable in Right-hand-side figure

screenshot from 2016-11-15 09 09 33

Code

library("psych")
library("gplots")
library("limma")
library("Vennerable")

tl <- "masi"
ids <- seq(1,11)
M.cor <- cor(mtcars)
colnames(M.cor) <- ids
rownames(M.cor) <- ids
p.mat.all <- psych::corr.test(M.cor, adjust = "none", ci = F)
alpha <- c(0.05)

# http://stackoverflow.com/q/2471188/54964
p.mat.p <- (p.mat.all[["p"]] < alpha)
p.mat.t <- (p.mat.all[["t"]] < alpha)
p.mat.r <- (p.mat.all[["r"]] < alpha)

## 1st Venn Diagram
# http://www.ats.ucla.edu/stat/r/faq/venn.htm
c3 <- cbind(c(p.mat.p), c(p.mat.t), c(p.mat.r))
a <- vennCounts(c3)  
vennDiagram(a, 
  names = c("p", "t", "r"), 
  cex = 2, counts = "red", 
  main = tl  
)

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

## 2nd Venn
Vstem <- Venn(lista)
plot(Vstem, doWeights = TRUE, type = "circles")

tail(warnings(), 100) # see the last two warnings only (via '[' method)
dev.off()

I think the complication of this issue is the ticket #38 .

No warnings or errors.

R: 3.3.1
OS: Debian 8.5