问题描述
我正在尝试使用
创建 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 对象的集合
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,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>
有人有解决办法吗?
解决方法
pdf("summary3.pdf",onefile=TRUE)
do.call(ggarrange,c(graphsList,list(ncol = 2,nrow=3,rremove("x.text"),align="hv")))
dev.off()