1

I am trying to create a proportional Venn Diagram with three groups. I searched the web and tried with 3 different packages: Venndiagram, venneuler and eulerr. However, with none it seems that it creates a correct proportional diagram. Can anyone help how to do this?

I tried with Venndiagram package:

library(Venndiagram)
draw.triple.venn(58, 44, 37, 44, 27, 37, 27, c("A", "B", "C"), euler.d = TRUE, scaled = TRUE)

Although scaled = TRUE, this gave me the following diagram: enter image description here

When using venneuler package:

library(venneuler)
v <- venneuler(c(A = 4, B = 0, C = 0, "A&B" = 10, "A&C" = 17, "B&C" = 0, "A&B&C" = 27))
plot(v)

enter image description here

This seemed to work better. However, as you can see, there is an area of B and C outside of A although this needs to be 0. Maybe this is impossible with circles?

zx8754
  • 52,746
  • 12
  • 114
  • 209
mswalma
  • 11
  • 2

1 Answers1

2

You are right, it is impossible with circles. However, if you're willing to use ellipses instead, the latest development version of eulerr (that I happen to the be creator of) can help you.

devtools::install_github("jolars/eulerr")

v <- eulerr::euler(c(A = 4, B = 0, C = 0,
                     "A&B" = 10, "A&C" = 17, "B&C" = 0, "A&B&C" = 27),
                   shape = "ellipse")
plot(v)

yields

enter image description here

Which is a perfect fit.

      original fitted residuals regionError
A            4      4         0           0
B            0      0         0           0
C            0      0         0           0
A&B         10     10         0           0
A&C         17     17         0           0
B&C          0      0         0           0
A&B&C       27     27         0           0

diagError: 0 
stress:    0 
Johan Larsson
  • 3,496
  • 18
  • 34
  • ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0' ld: warning: directory not found for option '-L/usr/local/gfortran/lib' ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [eulerr.so] Error 1 ERROR: compilation failed for package ‘eulerr’ * removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/eulerr’ * restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/eulerr’ Installation failed: Command failed (1) – mswalma Oct 29 '17 at 17:33
  • Thanks, this option seems perfect! However, when I run the command >devtools::install_github("jolars/eulerr") an error occures. I have posted it above (didn't fit in one comment, sorry) Do you know what happens here? Do I need to install additional packages? – mswalma Oct 29 '17 at 17:33
  • I know next to nothing about OSX, but are you maybe missing clang? – Johan Larsson Oct 29 '17 at 18:16
  • Rectangles will also work :-) – paxdiablo May 31 '23 at 20:01