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

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Tue Oct 20 23:07:10 CEST 2020



On 10/20/20 4:51 PM, Gábor Csárdi wrote:
> On Tue, Oct 20, 2020 at 9:45 PM Ben Bolker <bbolker using gmail.com> 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 works in testthat tests.
> 
> Gabor
> 
> [...]
> 

   oh OK, sorry.  The guts of the function are (in testthat:::on_cran(), 
which can't be used because it's not exported)

!identical(Sys.getenv("NOT_CRAN"), "true")



More information about the R-package-devel mailing list