Hi Robert, My understanding is that the "requireNamespace" trick, combined with listing the package in "Suggests" is the standard way to implement optional dependencies. Users of limma that never use duplicateCorrelation or other functions that require statmod will never need to install it.
For more info, see this old post about the same problem: https://support.bioconductor.org/p/16932/ Regards, Ryan On Thu, May 10, 2018 at 11:58 PM Robert Castelo <robert.cast...@upf.edu> wrote: > hi, > > this is a question for limma developers. > > at every new fresh installation of BioC and limma i get this message > when i use 'duplicateCorrelation()': > > "statmod package required but is not installed" > > i just install 'statmod' and problem solved. this, however, triggers > questions from some of my students since they expect that BioC > dependencies within functions are automatically installed when the > desired package is installed for the first time. > > i've observed within the limma source that the 'statmod' functionality > is used within other functions and in all cases this is dealt as in > 'duplicateCorrelation()', where first it's checked whether the package > namespace can be loaded and the user is asked otherwise to install it: > > if(!requireNamespace("statmod",quietly=TRUE)) stop("statmod package > required but is not installed") > > and the 'statmod' package is listed in the 'Suggests:' field of the > DESCRIPTION file. > > just out of curiosity, is there a particular reason to import the > functionality of 'statmod' in this way? wouldn't be possible to do it > via 'Imports:'? > > > thanks! > > robert. > > _______________________________________________ > Bioc-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/bioc-devel > [[alternative HTML version deleted]] _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel