我有一個數百萬的數據點的情節,所以我期待先製作一個png
然後包含它。但是,當我編譯時,我遇到了不能包含png
的問題。如何創建然後包括在Sweave中的png圖
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htb]
<<fig=TRUE,echo=FALSE>>=
png('test.png')
plot(rnorm(100))
dev.off()
@
\includegraphics{test}
\end{figure}
\end{document}
調用上述MWE後,我便會去我R
控制檯就像往常一樣撥打:
Sweave("report.Rnw")
texi2pdf("report.tex")
其中一期工程,除非我在Rnw
文件上面的代碼中所有的時間。錯誤信息:
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, :
Running 'texi2dvi' on 'report.tex' failed.
LaTeX errors:
!pdfTeX error: pdflatex (file ./report-019.pdf): PDF inclusion: requir
ed page does not exist <0>
==> Fatal error occurred, no output PDF file produced!
> Sweave("report.Rnw") ; texi2pdf("report.tex")
Writing to file report.tex
但OP有相同的參數。你的回答並沒有闡明它的作用,也沒有充分解釋任何人尋求幫助(未經證實)的變化。 –
是啊,沒有澄清任何事情,只是想讓它工作在一個整潔的方式。 –