Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roxygen2 requests #9

Open
dgkf opened this issue Apr 3, 2024 · 0 comments
Open

roxygen2 requests #9

dgkf opened this issue Apr 3, 2024 · 0 comments

Comments

@dgkf
Copy link
Owner

dgkf commented Apr 3, 2024

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 (<condition>) (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}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant