【发布时间】:2021-03-15 02:30:19
【问题描述】:
我正在尝试使用
创建一个 pdf 输出pdf("summary3.pdf",onefile=TRUE)
do.call(ggarrange, c(graphsList, list(ncol = 2, nrow=3, rremove("x.text"), align="hv" ) ))
dev.off
graphsList 是 qplot 对象的集合,这些对象是通过 this 循环得到的
emo_plot[[cor]] <- qplot(sentiment, xlab="Essay emotions", data=td_emo, weight=count, geom="bar",fill=sentiment)+ggtitle(pdfNames[cor])
生成的 summary.pdf 已损坏,无法打开。我读了
我需要一份打印声明。我试过了
f <- function(x){print(ggarrange(x))}
pdf("summary3.pdf",onefile=TRUE)
do.call(f, c(graphsList, list(ncol = 2, nrow=3, rremove("x.text"), align="hv" ) ))
dev.off
但我得到了错误
Error in (function (x) :
unused arguments (list(list(c("negative", "positive")
另外,当我尝试做 dev.off 时,我得到了这个
dev.off
function (which = dev.cur())
{
if (which == 1)
stop("cannot shut down device 1 (the null device)")
.External(C_devoff, as.integer(which))
dev.cur()
}
<bytecode: 0x0000021967e8fc50>
<environment: namespace:grDevices>
有人有解决办法吗?
【问题讨论】:
-
您的第一次尝试是正确的。使用
dev.off()而不是dev.off。 -
感谢罗纳克沙阿。这似乎是您发现的问题。顺便问一下,我该如何结束这个问题并感谢您?