[R] Converting .Rout file to pdf via Sweave automatically

Duncan Murdoch murdoch.duncan at gmail.com
Sat Jan 14 11:45:43 CET 2012


On 12-01-13 10:21 PM, Parag Magunia wrote:
> The R documentation mentions to create a PDF or DVI file from an Rnw template, the Sweave command can be used used.
>
> However, is there any way to go from a .Rout file straight to pdf with an Rnw template ?
>
> What I'm trying to avoid is adding the Sweave markup to the .tex file manually.
>
> What I think I'm missing is the exact arguments to the Sweave command.
>
> I tried numerous forms of:
>
> Sweave("batch.Rout", RweaveLatex(), "myR.Rnw");
>
> but without any succuess.

You misunderstand Sweave.  You don't add markup to the Rout file or the 
tex file, you add markup to the input file.  Usually you name it as Rnw.

For a case where you want to print everything in the batch file and 
there are no graphs, you could just put markup at the very beginning and 
at the very end.  Figures are slightly more complicated, but it sounds 
like you don't need them.

Duncan Murdoch



More information about the R-help mailing list