Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 4组之间重复项数量的维恩图_R - Fatal编程技术网

R 4组之间重复项数量的维恩图

R 4组之间重复项数量的维恩图,r,R,这是我的df: df <- data.frame(Group1=c("a","u","b","v","c","z","e","f","k","m","i"), Group2=c("a","u","b","v","y","d","e","t","l","h","i"), Group3=c("a","u","b","v","c","d","r","f","g","n","o"), Group4

这是我的df:

df <- data.frame(Group1=c("a","u","b","v","c","z","e","f","k","m","i"),
                 Group2=c("a","u","b","v","y","d","e","t","l","h","i"),
                 Group3=c("a","u","b","v","c","d","r","f","g","n","o"),
                 Group4=c("a","u","x","w","c","d","s","j","g","h","i"))

df您可以检查
VennDiagram
软件包

library(VennDiagram)
venn.plot <- venn.diagram(x = as.list(df), filename = NULL )
grid.draw(venn.plot)
库(VennDiagram)

venn.plot如果我们重铸每个列,使其具有相同的级别:

levs<-unique(unlist(df))
df2 <- lapply(df, factor, levs)
我想您可以复制vennCounts函数的定义来保存每次加载的limma

incid <- sapply(df2, table)
source("http://bioconductor.org/biocLite.R")
biocLite("limma")
vennCounts(incid)