[R] package docs: examples format

Gabor Grothendieck ggrothendieck at gmail.com
Wed Apr 5 15:52:43 CEST 2006

On 4/5/06, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:
> Sarah Goslee wrote:
> > Hello,
> >
> > The package I'm finishing up contains a series of functions
> > intended to be run one after the other, as in:
> > do data-prep using A()
> > run complicated, slow, analysis B()
> > do complicated, slow additional analysis C()
> > plot the results with D() and E()
> >
> > Now, in the documentation for each of those functions,
> > I put the entire sequence to illustrate the proper sequence.
> > But this means that the time-consuming B() and C() run several
> > times during package checking, taking far too long.
> >
> > I know that I can use
> > \dontrun{B()}
> > to show the sequence in the help without actually executing it each time.
> >
> > Is that the preferred approach, or is there something "nicer"?
> > Ideally, I'd like to include one global example that covers all related
> > functions, but I can't find a way to do that neatly (other than possibly
> > a vignette?).
> What about an additional help page that relates to the whole package
> rather than to a single function and contains the examples? Each
> function's help page can point with a \link{} to that help page.

And that page would be of the form: mypkg-package.Rd and you
could use the R promptPackage command to generate an outline
for it.

More information about the R-help mailing list