Hi,
I am not clear what commands R-Studio runs when the "Compile PDF" button is clicked.
I am using Sweave and a Rnw file to produce a PDF. Using R studio, when I click the "Compile PDF" button the Rnw file is processed and the PDF is displayed (My local version of R-Studio is configured to use knitr, "pdflatex" to compile the files and the system viewer to display the compiled PDF).
However, I cannot do the same things in an R script.
I have run this command:
Sweave("template.Rnw")
and gotten a message that a tex file has been written. I don't know how to compile this tex file within R.
When I try
knit2pdf("template.Rnw")
I get the following error:
output file: template.tex
Error: Failed to compile template.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "template.tex"' had status 1
So, how do I replicate the commands run by the "Compile PDF" button in an R script?
TIA
AB