我正在try 对一些数据集进行表示,以显示不同组之间有多少元素是通用的.
我正在考虑做一些类似于维恩图的事情,但对于这个表示法来说,有一个问题.
在这里,我正在做一个我的问题的非常简单的例子.让我们假设我有这样一个 list :
my_list=list(c("A", "A", "A", "B", "B"), c("A", "A", "A", "C"), c("A", "A", "A", "D")
我可以用维恩图来表示它,如下所示:
library(VennDiagram)
display_venn <- function(x, a_category){
grid.newpage()
venn_object <- venn.diagram(x, category.names = a_category, filename = NULL)
grid.draw(venn_object)
}
display_venn(my_list , a_category=c("set1", "set2", "set2")
此命令的输出为:
This is because the elements in the list are considered ONLY ONCE.
So, it is like to have ("A", "B"), ("A", "C"), and ("A", "D").
The problem is that this is not what I want.
I need a representation that shows the amount of elements.
So, for set1 would be: 3 in common, 2 alone.
So, for set2 would be: 3 in common, 1 alone.
So, for set3 would be: 3 in common, 1 alone.
Is there some kind of "Venn diagram" (at this point I am not sure even if it is a Venn representation) library that deals with duplicates?
Thanks for any help.