[R-pkg-devel] How to manage using different packages if available (suggests - imports)

Knut Krueger rhe|p @end|ng |rom krueger-|@m||y@de
Thu Feb 18 18:48:25 CET 2021


Am 18.02.21 um 16:52 schrieb Duncan Murdoch:

> you can suppress them using by having environment variable 
> _R_CHECK_FORCE_SUGGESTS_ set to "FALSE".  If you are worried about a 
> CRAN submission, explain to them in your submission message why they 
> can't have all your suggested packages.

Yes this is my major problem.
Thank you for your help

Knut
> 
> Duncan Murdoch
> 
> On 18/02/2021 10:36 a.m., Knut Krueger wrote:
>> The following problem:
>>
>> there are three packages foo1, foo2 and foo3 to use with the update of a
>> package. The availability depends on the configuration of the host
>> system. f.e java version
>>
>> If I write in the Description
>>
>> ...
>> Suggests: foo1, foo2, foo3
>> ....
>>
>> inside of functions if have:
>>
>> functionfoo <- function(data,usingpackage {
>> .....
>> foo1, foo2 and foo3
>>    if (usingpackage == "foo1") {
>>    do_something
>> }
>>
>> .....
>>
>> if (usingpackage == "foo2") {
>>    do_something
>> }
>> ....
>> if (usingpackage == "foo3") {
>>    do_something
>> }
>>
>> ....
>> }
>>
>> But of course it is not possible to get a positive check result.
>> It starts either with the missing package at suggest statement
>> or if I remove the suggest statement there is an error
>>     '::' or ':::' imports not declared from:
>>        ‘foo1’ ‘foo2’ ‘foo3’
>>      'loadNamespace' or 'requireNamespace' calls not declared from:
>>        ‘foo1’ ‘foo2’ ‘foo3’
>>
>> Any hints to solve this issue?
>>
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>



More information about the R-package-devel mailing list