2

I am trying to change the R Sweave command to knitr on linux. The current (R Sweave) command is found under options > configure:

R CMD Sweave %.Rnw

Yihui gives and example of how to do this on windows here.

How would you do this on linux (ubuntu)?

4

2 回答 2

4

Rscript isn't called by using Rscript.exe on Linux. Just change Rscript.exe to Rscript.

于 2013-03-18T18:38:06.117 回答
1

I just wanted to add that I just discovered that the abovementioned code does not work when child Rnw documents are included with \Sexpr{knit_child('path')}.

Use Rscript -e "library(knitr); knit('%.Rnw')" instead.

Please mention in the comments if you know of any difference in output between knit::knit2pdf() and knit().

于 2013-05-30T07:53:19.567 回答