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

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Wed, 25 Apr 2012 11:17:01 -0400

On 25/04/2012 10:20 AM, Liviu Andronic wrote:
> On Wed, Apr 25, 2012 at 3:41 PM, Duncan Murdoch
> <murdoch.duncan_at_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, this is what "Sweave functions" (or are these macros?)
> look like:

Yes. They're definitely macros, not functions: pure text substitution.

Duncan Murdoch
>
>
> <<>>=
> d<- iris
> ind<- 1:2
> @
>
> <<sw>>=
> summary(d[ , ind])
> cor(d[ , ind])
> @
>
> <<>>=
> d<- iris
> ind<- 2:4
> <<sw>>
> @
>
>
> Regards
> Liviu
>
> [1] vignette('Sweave', 'utils')



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 25 Apr 2012 - 15:20:09 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Wed 25 Apr 2012 - 15:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive