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)?

Bastiaan Quast
  • 2,802
  • 1
  • 24
  • 50

2 Answers2

4

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

Dason
  • 60,663
  • 9
  • 131
  • 148
  • Any idea how to extend the command above to open produced pdf file in internal viewer? – Andrej Sep 03 '13 at 19:42
  • Isn't there a separate option for setting the viewer stuff? I'm not at my linux box right now so I can't check... – Dason Sep 03 '13 at 23:44
  • Is there a problem with clicking the View PDF button once after you compile the document? The PDF should be updated automatically after each compilation – Dason Sep 04 '13 at 19:57
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().

Thibaud Ruelle
  • 303
  • 1
  • 16