From mxkuhn at gmail.com  Sun Dec  2 01:45:17 2007
From: mxkuhn at gmail.com (Max Kuhn)
Date: Sat, 1 Dec 2007 19:45:17 -0500
Subject: [Rd] [R] Sweave: Variables in code chunk headers
In-Reply-To: <4751CA79.6060507@stats.uwo.ca>
References: <fis1g7$65a$1@ger.gmane.org>
	<loom.20071201T171543-701@post.gmane.org> <fisd7m$85f$1@ger.gmane.org>
	<4751CA79.6060507@stats.uwo.ca>
Message-ID: <6731304c0712011645i1c6f2684l15579e3ede521b95@mail.gmail.com>

On Dec 1, 2007 3:56 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:

> My understanding is that Michael wants to have the Sweave options in a
> chunk depend on a calculation happening in the underlying R session.
> This is hard to do with hooks, because they are run after the options
> have already been processed.

This may not be of practical help, but odfWeave allows you to do this
(assuming that I understand the question).

One clean way to do this in Sweave would be to change how
the device is called. In odfWeave, if <<fig=TRUE>>=. a new device
is opened and the image specifications are retreived from
global variables. See odfWeave:::RweaveOdfRuncode,
setimageDefs and adjustImageSize in the odfWeave package.

I'd love to see this type of change in Sweave, but it would be a
big departure form the current code base.

-- 

Max



[Rd] [R] Sweave: Variables in code chunk headers
Max Kuhn