Skip to content
Prev 18266 / 21312 Next

[Bioc-devel] Reducing number of dependencies

Hi David,

My experience is to put those packages that are necessary for the "core
analysis" in your package to Depends/Imports and put those packages that
are only needed for the "additional analysis" in your package to Suggests.
Then in the function which needs these "suggested packages", you can write
like:

if(!requireNamespace(pkg)) {
   stop("You need to install pkg to perform this analysis.")
}

An example from my package:
https://github.com/jokergoo/spiralize/blob/master/R/graphics.R#L1355.

Cheers,
Zuguang


On Tue, 6 Jul 2021 at 03:52, David Jimenez-Morales <biodavidjm at gmail.com>
wrote: