Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-21 Thread Andy Teucher
Thanks Martin, I agree that the example should run for a user when calling example() - hence I am going with a simple try() around the function calls in the examples. I agree your more sophisticated version has better behaviour, but I don’t want to clutter the examples with code that might just

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-21 Thread Martin Maechler
> Ben Bolker > on Tue, 20 Oct 2020 17:07:10 -0400 writes: > On 10/20/20 4:51 PM, Gábor Csárdi wrote: >> On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker wrote: >> [...] >>> if (testthat::skip_on_cran()) >>> >>> all seem like reasonable solutions. >> >> I d

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-20 Thread Gábor Csárdi
On Tue, Oct 20, 2020 at 10:07 PM Ben Bolker wrote: > > > > On 10/20/20 4:51 PM, Gábor Csárdi wrote: > > On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker wrote: > > [...] > >> if (testthat::skip_on_cran()) > >> > >> all seem like reasonable solutions. > > > > I don't think you can use `testthat::ski

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-20 Thread Ben Bolker
On 10/20/20 5:10 PM, Gábor Csárdi wrote: On Tue, Oct 20, 2020 at 10:07 PM Ben Bolker wrote: On 10/20/20 4:51 PM, Gábor Csárdi wrote: On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker wrote: [...] if (testthat::skip_on_cran()) all seem like reasonable solutions. I don't think you can u

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-20 Thread Ben Bolker
On 10/20/20 4:51 PM, Gábor Csárdi wrote: On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker wrote: [...] if (testthat::skip_on_cran()) all seem like reasonable solutions. I don't think you can use `testthat::skip_on_cran()` for this, it does not return a logical flag: ❯ isTRUE(testthat::skip

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-20 Thread Gábor Csárdi
On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker wrote: [...] >if (testthat::skip_on_cran()) > > all seem like reasonable solutions. I don't think you can use `testthat::skip_on_cran()` for this, it does not return a logical flag: ❯ isTRUE(testthat::skip_on_cran()) Error: Reason: On CRAN It only

Re: [R-pkg-devel] Usage of internet resources in examples

2020-10-20 Thread Ben Bolker
Depending on what you want to do, if (interactive()) or try() (in the examples, not in the function) or if (testthat::skip_on_cran()) all seem like reasonable solutions. On 10/20/20 4:28 PM, Andy Teucher wrote: Our package bcdata (https://cran.r-project.org/package=bcdata) retri