[R-pkg-devel] What To Include In \donttest{}

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Thu May 27 04:37:02 CEST 2021


Danielle,

On 26 May 2021 at 21:23, Danielle Maeser wrote:
| Please excuse the very simple question, but I received the following
| message from a CRAN maintainer, and I am not sure what code to include
| inside of the \donttest{}. This is meant to enclose code that typically
| should be run, but not during package checking, and I do not have any such
| code.
| 
| Here is the message from the CRAN maintainter:
| 
| *Please add small executable examples in your Rd-files to illustrate theuse
| of the exported function but also enable automatic testing.Otherwise, you
| can also write some tests. Lengthy examples (> 5 sec) canbe wrapped in
| \donttest{}.*
| 
| I'd appreciate any assistance you can provide.

The quote contains three distinct sentences--with three distinct messages:

  1. Please add examples, for both illustration and tests.
  2. You can also add tests directly (i.e. via directory tests/)
  3. Should examples run long, consider wrapping them in \donttest{}

We can narrow this down to 'please add examples'.

(Otherwise, a good trick is to search at GitHub in the (unofficial,
contributed) cran organization (mirroring CRAN) for terms you are interested
in, here "\donttest" -- and this link claims 11k hits
  https://github.com/search?q=org%3Acran+%5Cdonttest&type=code
you can probably browse a few of these to get an idea.

Hope this helps,  Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list