Skip to content
Prev 2782 / 12125 Next

[R-pkg-devel] Conditional use of suggested package in example code

Hi Martin

Thank you for your reply.
I agree with you. In my specific example, I later also use MASS::ginv(), but unfortunately that was not visible in the excerpt.
Thank you for that!
But how do I only hide the if statement and its closing curly brace? The following doesn?t work:
The example section on the help page is empty, because the curly braces of the if statement and the \dontshow get mixed up. 

Ordering the statements this way:
is better, but the opening and closing curly brace of the if statement remain on the help page. 

Furthermore, I keep the examples in standalone files that I include in the documentation using roxygen2?s @example. Adding the \dontshow markup means I can?t source them anymore.
Quoting from the WRE manual:
So according to the manual, even MASS needs a conditional.

I do use random data in my tests, but I think that the examples profit from using a real dataset.

Regards
Christian