[Tex/LaTex] Is it possible to get Sweave/knitr in RStudio to output the .tex file without typesetting it

knitrrrstudiosweave

I would like to know if it is possible to tell Sweave or knitr in RStudio to create the .tex file without trying to typeset it. I want to be able to run my .Rnw file and produce a .tex file which I would typeset using another computer with a proper installation of LaTeX.

The reason I want to do it is because my data for the statistical analysis is in a computer where I cannot have LaTeX installed (not even a mobile installation), and my LaTeX installation is in another computer.

Can I do that? How should I do it?

Best Answer

(Upgraded from a comment.)

Just use library("knitr"); knit("file.Rnw") in the console (where "file.Rnw" is the name of your Sweave file, of course). This will produce "file.tex" in the working directory.