Skip to content
Prev 9579 / 12125 Next

[R-pkg-devel] A simple question regarding examples

On Thu, 21 Sep 2023 00:03:11 +0000
Hanyu Song <hanyu.song at duke.edu> wrote:

            
\dontrun{} is reserved for things that either cannot be guaranteed to
work (highly dependent on the user's system), involve examples of
interactive input/output (e.g. ?debugger), or are potentially too
destructive in case they break (e.g. ?connections). The \examples
section should include running code, which example(your_func) should
run. If there's only the \dontrun{} section, it won't pass the review.

For things that ought to work, it's best to reduce inputs further until
the example runs within the time limit. One remaining escape hatch is
\donttest{}, but R CMD check --as-cran still involves running
\donttest{} examples. Putting the whole example in a \donttest{}
section doesn't sound like a good idea either.