Re: [R] Sweave : change value in rnw file to generate multiple "single" reports ?

From: Dieter Menne <>
Date: Mon, 10 Dec 2007 16:53:32 +0000 (UTC)

Ptit_Bleu <ptit_bleu <at>> writes:

> Is there a way to pass arguments to Sweave like Sweave("myfile.rnw",
> namevar="Device2") and it will change namevar by Device2 into the file
> myfile.rnw before creating the .tex file ?
> Or is it possible to do it via another language, that is: loading the rnw
> file, modifying it, saving it and finally calling Sweave ?

You can set an environment variable in the system (SET DELTA=...), and read it in from R:


Works for Windows with a rather inconsistent implementation of environment strings, so it should work the better with Linux.

Dieter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 10 Dec 2007 - 17:28:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Dec 2007 - 17:30:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.