You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When referring to the documentation I noticed @examples were wrapped in if(FALSE){}, probably so they don't run while package building or on CRAN because they would take too long or require credentials.
Isn't it better to instead use:
if(interactive()){}: only run when session is interactive
\dontrun{} (but we'd still need one example per function for CRAN)
@examplesIf interactive(), doesn't show the if clause in the rendered documentation, and I believe is allowed by CRAN
When referring to the documentation I noticed @examples were wrapped in
if(FALSE){}
, probably so they don't run while package building or on CRAN because they would take too long or require credentials.Isn't it better to instead use:
if(interactive()){}
: only run when session is interactive\dontrun{}
(but we'd still need one example per function for CRAN)@examplesIf interactive()
, doesn't show the if clause in the rendered documentation, and I believe is allowed by CRANI prefer this last solution, and this is similar as to how {googledrive} does it:
https://github.com/tidyverse/googledrive/blob/ed574d9eb3308619fc3e735251bfd42e6cfdb8e2/R/drive_read.R#L25
I believe interactive() is a suitable condition to running the examples, this would allow users to use
example()
as well.The text was updated successfully, but these errors were encountered: