Skip to content

\include-mechanism in Sweave?

4 messages · Dietrich Trenkler, Tobias Verbeke, Mark Wardle

#
Dear HelpeRs,

I'm very fond of Sweave and I use it as often as possible.  It'a a pity
I can't use it for larger projects or can I?

For instance suppose I have three files file1.rnw, file2.rnw and
file3.rnw with Sweave code.  Working on file2.rnw I whould like to
exclude file1.rnw and file3.rnw temporarily and joining all of them
later.  This amounts to a mechanism similar to using LaTeX's \include
command.  *Is* there a way to achieve that?

Thank you in advance.

D. Trenkler
#
Dietrich Trenkler wrote:
\SweaveInclude{} lets you do just that.

HTH,
Tobias
#
Tobias Verbeke wrote:
Oops. \SweaveInput{}

Sorry,
Tobias
#
Hi Dietrich,

I am writing my thesis, made up of several papers that have been
expanded into chapters. Each "chapter" was a .tex file until I started
using Sweave.

Now each chapter is an .Rnw file. My master LaTeX document has this:

\include{introduction}
\include{epidemiology}
\include{report}

Latex will look for introduction.tex, epidemiology.tex and report.tex.
I can get LaTeX to only process the introduction by using \includeonly

Of course, the .tex files are generated from Rnw files via a Makefile.
This makefile will only re-generate tex files from Rnw files if the
Rnw file is updated (unless you  give it different rules).

See post: http://tolstoy.newcastle.edu.au/R/e2/help/06/11/4891.html

Hope this helps,

Mark
On 29/06/07, Dietrich Trenkler <Dietrich.Trenkler at uni-osnabrueck.de> wrote: