r VennDiagram make.truth.table 'error could not find function' how can I get this to work?

927 Views Asked by At

I am trying out the example from the package documentation; VennDiagram::make.truth.table:

 make.truth.table(c(a = 1, b = 2, c = 3, d = 4))

I get this error:

Error in make.truth.table(c(a = 1, b = 2, c = 3, d = 4)) : 
  could not find function "make.truth.table"

I have found nothing online about this function except the VennDiagram documentation.

Please help me understand:

a) the function output

b) why it is not working

I am using:

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
RStudio version 1.0.153

attached base packages:

[1] grid      stats     graphics  grDevices utils     datasets  methods   base  

other attached packages:

[1] VennDiagram_1.6.17  futile.logger_1.4.3 knitr_1.17
1

There are 1 best solutions below

0
On BEST ANSWER

I believe this function was replaced by get.venn.partitions() after the package was updated. However, the documentation was not updated, and it should be.

get.venn.partitions(list(a = 1, b = 2, c = 3, d = 4))

Which outputs:

       a     b     c     d                    ..set.. ..values.. ..count..
1   TRUE  TRUE  TRUE  TRUE                    anbncnd                    0
2  FALSE  TRUE  TRUE  TRUE               (bncnd)\\(a)                    0
3   TRUE FALSE  TRUE  TRUE               (ancnd)\\(b)                    0
4  FALSE FALSE  TRUE  TRUE        (cnd)\\(a<U+222A>b)                    0
5   TRUE  TRUE FALSE  TRUE               (anbnd)\\(c)                    0
6  FALSE  TRUE FALSE  TRUE        (bnd)\\(a<U+222A>c)                    0
7   TRUE FALSE FALSE  TRUE        (and)\\(b<U+222A>c)                    0
8  FALSE FALSE FALSE  TRUE (d)\\(a<U+222A>b<U+222A>c)          4         1
9   TRUE  TRUE  TRUE FALSE               (anbnc)\\(d)                    0
10 FALSE  TRUE  TRUE FALSE        (bnc)\\(a<U+222A>d)                    0
11  TRUE FALSE  TRUE FALSE        (anc)\\(b<U+222A>d)                    0
12 FALSE FALSE  TRUE FALSE (c)\\(a<U+222A>b<U+222A>d)          3         1
13  TRUE  TRUE FALSE FALSE        (anb)\\(c<U+222A>d)                    0
14 FALSE  TRUE FALSE FALSE (b)\\(a<U+222A>c<U+222A>d)          2         1
15  TRUE FALSE FALSE FALSE (a)\\(b<U+222A>c<U+222A>d)          1         1

This is indeed the truth table. As a useful aside, this function is important to help make sense of the calculate.overlap function as the counts in the truth table help you identify which list corresponds to which overlap.

#For example
print(example<-calculate.overlap(list(a = 1, b = 2, c = 3, d = 4)))