我正在尝试使用 VennDiagram 包中的 calculate.overlap 函数来首先计算然后打印一个维恩图。我能够计算我的数据集的重叠,但正在寻找如何打印维恩图形的帮助。任何人都可以提供帮助吗?我通读了文档,但没有找到这个。

> library('VennDiagram')

# A simple single-set diagram
cardiome <- letters[1:10]
superset <- letters[8:24]
overlap <- calculate.overlap(
x = list(
"Cardiome" = cardiome,
"SuperSet" = superset
)
);

最佳答案

另一个简单的例子展示了如何使用 VennDiagram 包打印维恩图:

library(VennDiagram)
cardiome <- letters[1:10]
superset <- letters[8:24]
overlap <- calculate.overlap(
x <- list("Cardiome"=cardiome, "SuperSet"=superset))

venn.plot <- draw.pairwise.venn(
    area1 = length(cardiome),
    area2 = length(superset),
    cross.area = length(overlap),
    category = c("Cardiome", "Superset"),
    fill = c("blue", "red"),
    lty = "blank",
    cex = 2,
    cat.cex = 2,
    cat.pos = c(180, 180),
    cat.dist = 0.05,
    cat.just = list(c(0, 1), c(1, 1))
    )
grid.draw(venn.plot)
savePlot(filename="venndiag", type="png")

r - 计算重叠后打印维恩图-LMLPHP

集合内带有项目标签的维恩图:
library(RAM)
vectors <- list(Cardiome=cardiome, Superset=superset)
group.venn(vectors=vectors, label=TRUE,
    fill = c("blue", "red"),
    cat.pos = c(180, 180),
    lab.cex=1.1)

r - 计算重叠后打印维恩图-LMLPHP

关于r - 计算重叠后打印维恩图,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45902376/

10-12 18:23