Parag Magunia
2012-Jan-14 03:21 UTC
[R] Converting .Rout file to pdf via Sweave automatically
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.
Duncan Murdoch
2012-Jan-14 10:45 UTC
[R] Converting .Rout file to pdf via Sweave automatically
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