[R] I want to use Sweave, but only sometimes

cls59 sharpsteen at mac.com
Tue Apr 14 03:13:24 CEST 2009



Paul Johnson-11 wrote:
> 
> Does anybody have a workable system to run an Rnw document through
> R-Sweave when necessary, but to just run it through LaTeX if no new R
> calculations are needed? I.e.,  the figures already exist, I do not
> need R to do more work for me, so I send the document straight to
> LaTeX.
> 

The cacheSweave package does just that. A friend and I are also working on
another package called pgfSweave that incorporates code chunk caching along
with native compilation of R graphics output inside LaTeX so there are no
font differences. cacheSweave is available from CRAN and has been released
for a while now. Currently pgfSweave is only available from rforge.net and
is very much in beta. Hopefully things will really get moving this summer.

If you want to turn a .Rnw file into a plain LaTeX file, just run it through
Sweave('myPaper.Rnw') from the R command line. This creates myPaper.tex
which contains all the output and none of the << >>= @ chunk operators.

Also, your intuitions about the \SweaveOpts{prefix.string=figs/} command are
correct- this does specify a subfolder for figure output to reside in. Just
make sure you have created the folder yourself before running Sweave
otherwise it will give an error.

Hope that helps!

-Charlie

-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: http://www.nabble.com/I-want-to-use-Sweave%2C-but-only-sometimes-tp23026260p23031551.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list