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

Max Kuhn mxkuhn at gmail.com
Sun Dec 2 01:45:17 CET 2007


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



More information about the R-devel mailing list