R 如何在大量的文迪格拉姆中使用逗号?
我有一个维恩图,我用维恩迪亚格拉姆软件包制作。数字超过了10万 我希望中间的数字是150001,带逗号分隔符,或者是150000,中间有一个小空格。这可能与文迪格拉姆有关吗 这是我的例子R 如何在大量的文迪格拉姆中使用逗号?,r,venn-diagram,R,Venn Diagram,我有一个维恩图,我用维恩迪亚格拉姆软件包制作。数字超过了10万 我希望中间的数字是150001,带逗号分隔符,或者是150000,中间有一个小空格。这可能与文迪格拉姆有关吗 这是我的例子 library(VennDiagram) venn.diagram(x = list(A = 1:200000,B = 50000:300000), filename = "../example.tiff") 我认为你做这件事不容易。有两种打印模式,raw和percent,但它们是在函数中硬编码的(请查看V
library(VennDiagram)
venn.diagram(x = list(A = 1:200000,B = 50000:300000), filename = "../example.tiff")
我认为你做这件事不容易。有两种打印模式,
raw
和percent
,但它们是在函数中硬编码的(请查看VennDiagram::draw.triple.venn
)。您可以通过更改函数(我不喜欢)或手动调整GROB(如下所示)来添加格式
库(VennDiagram)
p这可能有帮助:格式(2000,big.mark=“,”)
。
library(VennDiagram)
p <- venn.diagram(x = list(A = 1:200000,B = 50000:300000), filename = NULL)
# Change labels for first three text grobs
# hard-coded three, but it would be the number of text labels
# minus the number of groups passed to venn.diagram
idx <- sapply(p, function(i) grepl("text", i$name))
for(i in 1:3){
p[idx][[i]]$label <-
format(as.numeric(p[idx][[i]]$label), big.mark=",", scientific=FALSE)
}
grid.newpage()
grid.draw(p)