Skip to content
Prev 2433 / 12125 Next

[R-pkg-devel] How to (conditionally) use an archived package (without Suggests)?

On 24/02/2018 6:45 PM, Marius Hofert wrote:
That should be fine, as long as your package still works when "bar" is 
unavailable.  That is, use requireNamespace in a conditional:

if (requireNamespace("bar", quietly = TRUE)) {
   # do the good stuff
} else {
   # do some less good substitute
}

without generating an error anywhere.
Right, you shouldn't refer to a package in code without mentioning it in 
the DESCRIPTION file.
I don't think so.  But CRAN policies may have changed...

Duncan Murdoch