hello.Rnw:
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
\end{document}
命令:
rnwfile <- system.file("Sweave", "hello.Rnw", package = "utils")
Sweave(rnwfile)
輸出:
Error in SweaveReadFile(file, syntax, encoding = encoding) : no Sweave file with name ‘’ found
問題
這裏有什麼問題?使用另一個更復雜的文件輸出相同。如果我將Sweave()僅添加到hello.Rnw文件的路徑,但不適用於更復雜的文件。然後輸出是:「錯誤:'test.Rnw'不是ASCII並且不聲明編碼」。
目的是創建由按鈕COMPILE PDF完成的命令。 – b4154
我會告訴你,如果我有任何其他輸出。我會嘗試 – b4154
你可以直接問這個問題......'knitr :: knit2pdf(「myfile」)',參見http://stackoverflow.com/questions/34591487/difference-compile-pdf-button-in-rstudio -vs-knit-and-knit2pdf –