[R] package docs: examples format

Thomas Lumley tlumley at u.washington.edu
Wed Apr 5 16:53:24 CEST 2006

On Wed, 5 Apr 2006, 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?).

Why not use a vignette?  Documenting a process involving multiple 
functions is exactly what vignettes are designed for.


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-help mailing list