Message-ID: <CAM3-Kja33NTzqbZjZi2gLSy02ewzE2dDcCoe5XK2DtBebcpCYg@mail.gmail.com>
Date: 2018-02-24T23:59:55Z
From: Marius Hofert
Subject: [R-pkg-devel] How to (conditionally) use an archived package (without Suggests)?
In-Reply-To: <b5c85ca74e934fe5aa7cab8147f0d0c2@connhm04.connect.uwaterloo.ca>
>
> if (requireNamespace("bar", quietly = TRUE)) {
> # do the good stuff
> } else {
> # do some less good substitute
> }
>
> without generating an error anywhere.
Hi Duncan,
thanks for helping.
I use the above
>
>
>>
>> '::' or ':::' import not declared from: ?bar?
>> 'loadNamespace' or 'requireNamespace' call not declared from: ?bar?
>
> Right, you shouldn't refer to a package in code without mentioning it in
> the DESCRIPTION file.
This is my problem. It seems that even a *conditional* use already
requires the package name to appear in DESCRIPTION. 'bar' was in
Imports and I tried to submit 'foo' with 'bar' in Suggests. Both times
was not accepted. I don't see how even a conditional use of 'bar'
inside 'foo' is possible then.
Cheers,
Marius
>
>>
>> Does this mean it is not possible to use 'bar' anymore in 'foo'?
>
> I don't think so. But CRAN policies may have changed...
>
> Duncan Murdoch
>
>>
>> These are (somewhat) related references I found:
>> 1) https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Suggested-packages
>> 2) https://stat.ethz.ch/pipermail/r-devel/2013-February/065947.html
>>
>
>