dgkf / dgkf/testex

`roxygen2` requests

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
23
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Just keeping a few notes on changes that would help support this package in `roxygen2`:

- Duplicate `@examples` are joined with extra empty lines. Especially when `testex` tags are functionally special `@examples` tags, this introduces a lot of unintentional whitespace.
- `@examplesIf` changes the output value of the code, meaning that `.Last.value` is _not_ what might be otherwise expected by tests.
```
withAutoprint(1 + 2)
.Last.value
# == list(value = 3, visible = TRUE)
```
instead would be preferred if the code that executes a `@examplesIf` statement returns only the value:
```
if () (if (getRversion() >= "3.4") (function(x) \{ x <- as.list(substitute(x))[-1]; invisible(withAutoprint(x, evaluated = TRUE)$value) \}) else force)(\{ # examplesIf}
1 + 2
\dontshow{\}) # examplesIf}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.