[R] Sweave: \Sexpr{} inside <<>>?

Duncan Murdoch murdoch.duncan at gmail.com
Wed Jan 26 22:44:42 CET 2011


On 11-01-26 3:43 PM, zerfetzen wrote:
>
> Thanks Duncan, that helps.  It successfully displays what I'm looking for,
> but it is not executing it.  In a previous code chunk, it notes the time it
> took to run something, and in the successive code chunk, it runs something
> else where the previous time is now a parameter, but I'd like it to
> numerically display that previous time in the new chunk, rather than a
> variable name I create for it behind the scenes.  Is this possible?  Many
> thanks.

Of course it's possible, but it'll need ugly trickery.  Just do every 
calculation in a hidden chunk, then use code like I did to fake a 
display of it.

Duncan Murdoch



More information about the R-help mailing list