@doctestExample path/to/file.R is a drop-in replacement for
@example path/to/file.R. It doesn't add the contents of file.R to
the test.
Details
If you have complex examples you may want to store them separately.
Roxygen2 uses the @example tag for this. @doctestExample does the
same: it adds the contents of its file to the resulting example.
Suppose man/R/example-code.R contains the line:
Then the following roxygen:
will generate an example like:
At present, @doctestExample doesn't add any code to the tests.
@doctestExample was added in doctest 0.3.0.