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

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Thu Feb 18 16:52:55 CET 2021


I don't see your tests for the presence of the package you're using, but 
if you have those set up properly, the messages you get about some of 
your suggested packages not being available aren't going to matter, and 
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.

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