0
votes

I have the following data:

Set1    : 82
Set2    : 44
Set3    : 56
Set4    : 53
1,2     : 27
1,3     : 37
1,4     : 30
2,3     : 22
2,4     : 14
3,4     : 19
1,2,3   : 18
1,2,4   : 13
1,3,4   : 20
2,3,4   : 11
1,2,3,4 : 11

1,2 means Set1 . intersection . Set2, and so on ...

When I try to make a VennDiagram for this data-set using draw.quad.venn, i get the following error,

Error in draw.quad.venn(82, 44, 56, 53, 27, 37, 30, 22, 14, 19, 18, 13,  : 
Impossible: partial areas negative

I dont understand what i am doing wrong?

UPDATE:

The following is the command line that i used:

v.all <- draw.quad.venn( 82, 44, 56, 53, 27, 37, 30, 22, 14, 19, 18, 13, 20, 11, 10, category = c( "Set1", "Set2", "Set3", "Set4" ), fill=c( "red", "blue", "orange", "green" ), cex = 0.75, cat.cex=0.85 )

Interestingly, when i use

v <- venneuler( c( A=82, B=44, C=56, D=53, "A&B"=27, "A&C"=37, "A&D"=30, "B&C"=22, "B&D"=14, "C&D"=19, "A&B&C"=18, "A&B&D"=13, "A&C&D"=20, "B&C&D"=11, "A&B&C&D"=11 ))
plot(v)

It works!!

enter image description here

So now i am really confused.

2
You should a) Show the code you use to call draw.quad.venn (how would we know if you're calling it incorrectly?) and b) use dput to show a reproducible version of this data (that we can put into our own code to test out)David Robinson
is set1 83 the total space for set one? or the total non-overlapped space for set1? If it is the total space it is less than the area it overlaps with set 2,3, and 4.user1317221_G
@user1317221 there's nothing wrong with 82 being total space, since 2,3,4 are non-disjunct. My bet, not having viewed ?draw.quad.venn is that his arguments are in the wrong order or (taking your hint) the function wants non-overlapped spaces, not total spaces.Carl Witthoft
glad it works. venneuler plots A= 82 as the non-overlapping space. Did you check in your draw.quad.venn that the set1 82 is meant to be non-overlapping or total space as @Carl and I pointed to? that might be the original issue.user1317221_G
@user1317221 to the best of my understanding in draw.quad.venn Set1 82 is meant to be total space. But I could be wrong. I think i understand now what @Carl was saying.Sam

2 Answers

1
votes

The constraints in the code are straight forward. Here it is exactly;

     if (any(a1 < 0, a2 < 0, a3 < 0, a4 < 0, a5 < 0, a6 < 0, a7 < 
            0, a8 < 0, a9 < 0, a10 < 0, a11 < 0, a12 < 0, a13 < 0, 
            a14 < 0, a15 < 0)) {
            stop("Impossible: partial areas negative")
        }
1
votes

Without your code it is hard to help. Possibly it is impossible to draw your data due to the way it is supposed to overlap. Maybe you have errors in the data?

However if it is a code issue, using some of your data and a different package I can offer an alternative route:

require(venneuler)
m <- as.matrix(c(
0, 27, 37, 30,
27, 0, 22, 14,
37 ,22, 0, 19,
30,14,19,0)byrow=T,nrow=3)
v = venneuler(m)
plot(v)

which gives gives: