Re: [R] recommended way to group function calls in Sweave

2012-04-26 Thread Liviu Andronic
Dear Rainer On Wed, Apr 25, 2012 at 5:34 PM, Rainer Schuermann rainer.schuerm...@gmx.net wrote: chunk_name_1,eval=FALSE,echo=FALSE= I like the 'eval=FALSE' trick. SweaveInput( setup.Rnw ) and from here, I can suse the named chunks almost like function calls, as you you describe below.

[R] recommended way to group function calls in Sweave

2012-04-25 Thread Liviu Andronic
Dear all When using Sweave, I'm always hitting the same bump: I want to group repetitive calls in a function, but I want both the results and the function calls in the printed output. Let me explain myself. Consider the following computation in an Sweave document: summary(iris[,1:2])

Re: [R] recommended way to group function calls in Sweave

2012-04-25 Thread Duncan Murdoch
On 12-04-25 7:41 AM, Liviu Andronic wrote: Dear all When using Sweave, I'm always hitting the same bump: I want to group repetitive calls in a function, but I want both the results and the function calls in the printed output. Let me explain myself. Consider the following computation in an

Re: [R] recommended way to group function calls in Sweave

2012-04-25 Thread Liviu Andronic
On Wed, Apr 25, 2012 at 3:41 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: I would use the last method, or if the calls were truly repetitive (i.e. always identical, not just the same pattern), use a named chunk. Labeled chunks are indeed what I was looking for [1]. As far as I understand,

Re: [R] recommended way to group function calls in Sweave

2012-04-25 Thread Duncan Murdoch
On 25/04/2012 10:20 AM, Liviu Andronic wrote: On Wed, Apr 25, 2012 at 3:41 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: I would use the last method, or if the calls were truly repetitive (i.e. always identical, not just the same pattern), use a named chunk. Labeled chunks are indeed

Re: [R] recommended way to group function calls in Sweave

2012-04-25 Thread Rainer Schuermann
What I usually do when I have to write a report with some functions I use multiple times is that I put them in a separate file (call it setup.Rnw or so). The first chunk there loads the libraries, sets initial variable values etc: echo=FALSE, results=hide= library( xtable ) d - iris ind - 1 @