-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Use #' @examplesIf
roxygen directive over if()
in the docs
#318
Comments
Keep in mind that if your original conditional statement was something like: #' @examples
if (requireNamespace("zoo", quietly = TRUE)) {
...
} If you use #' @examplesIf requireNamespace("zoo", quietly = TRUE)
library(zoo)
... Thanks, @etiennebacher, for bringing up this issue. |
Hmm, but this is not too bad. At least, it shows all the output. I am a bit more concerned about some of the outputs not showing up at all on the website. I can create an issue in rstudio repo to check if they can handle this a bit better. Ideally, the following should not appear in the output: ## Don't show:
## End(Don't show)
}) # examplesIf |
I also checked in the PDF manual, and the examples look good. |
Created issue in RStudio to track the suboptimal rendering of examples when run in the IDE: rstudio/rstudio#12318 |
@rempsyc It would be great if you can also resolve this for report before the next submission. |
Is this necessary when the example is already wrapped in |
Yes, because CRAN tests |
* Get rid of warnings about aes_string * lints * Update utils.R * Use `#' @examplesIf` roxygen directive over `if()` easystats/easystats#318 * check class correctly * cleaning more lints * Update geom_from_list.R * use devel correlation * suppress all rstan warnings * fix a few more warnings * Update utils.R * use latest bayestestR * more dealing with warnings * suppress rstanarm warnings in tests * fix more deprecations from ggplot2 * remove ggraph example since it is producing warnings: thomasp85/ggraph#333 * bump deps * warnings in examples * remove NAs * lintr * addressing more lints * use more insight helpers * more line length linter * glmmTMB is needed * Update utils.R --------- Co-authored-by: Daniel <mail@danielluedecke.de>
bump |
What about |
Yepp, this is fine. In fact, it's one of the very few situations where |
Could you explain the difference here? Not sure I'm following |
There are a couple of reasons to do this:
if()
, only the final one will be displayed in the pkgdown website (cf. Only output from the final example is shown for examples in anif()
block r-lib/pkgdown#2175).This is not the case if we use
#' @examplesIf
instead.Progress tracker:
The text was updated successfully, but these errors were encountered: