0

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.

Sam
  • 7,922
  • 16
  • 47
  • 62
  • 1
    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 May 02 '12 at 18:28
  • 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 May 02 '12 at 19:16
  • @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 May 02 '12 at 20:11
  • 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 May 02 '12 at 21:09
  • @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 May 03 '12 at 00:31
  • @sam From the documentation for VennDiagram, it appears the author did not intend for draw.quad.venn to be called directly, and there's no documentation for it. Good reason not to use it :-) – Carl Witthoft May 03 '12 at 11:55
  • @CarlWitthoft you are probably right, but I did not see such explicit mention in the documentation that i found at http://cran.r-project.org/web/packages/VennDiagram/VennDiagram.pdf. – Sam May 03 '12 at 13:34

2 Answers2

1

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:

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
user1317221_G
  • 15,087
  • 3
  • 52
  • 78
1

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")
        }
Count Zero
  • 630
  • 1
  • 6
  • 15