我使用的是R sweave (*.Rnw),并且只想生成plotname.eps。
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
\SweaveOpts{eps=TRUE}
<<plotname, fig=TRUE, echo=F, prefix=F>>=
ggplot(data=data, aes(x = day, y = outside_act))
@
\end{document}当我编译这段代码时,生成了三个图: plotname.eps和plotname.pdf。如何抑制R sweave生成plotname.pdf?(我只需要plotname.eps,我不想让R sweave再次运行这个块。)
发布于 2018-12-16 20:08:54
您可以使用\SweaveOpts{eps=TRUE, pdf=FALSE}。有关可用选项的完整详细信息,请在R控制台中运行vignette("Sweave")。
但是,如果您需要的只是EPS文件而不是文档,则可以直接使用
setEPS()
postscript("filename.eps")
ggplot(data=data, aes(x = day, y = outside_act))
dev.off()在R脚本中。
https://stackoverflow.com/questions/53629548
复制相似问题