Søren Højsgaard
2021-Dec-04 15:54 UTC
[R] Handling dependencies on Bioconductor packages for packages on CRAN
Dear all My gRbase package imports the packages from Bioconductor: graph, RBGL and Rgraphviz If these packages are not installed, then gRbase can not be installed. The error message is: ERROR: dependency ?graph? is not available for package ?gRbase? If I, prior to installation, run setRepositories and highlight 'BioC software', then gRbase installs as it should, because the graph package from Bioconductor is installed along with it. However, this extra step is an obstacle to many users of the package which means that either people do not use the package or people ask questions about this issue on stack overflow, R-help, by email to me etc. It is not a problem to get the package on CRAN because, I guess, the CRAN check machines already have the three bioconductor packages installed. Therefore, I wonder if there is a way of specifying, in the DESCRIPTION file or elsewhere, that these packages should be installed automatically from bioconductor. An alternative would be if one could force the error message ERROR: dependency ?graph? is not available for package ?gRbase? to be accompanied by a message about what the user then should do. Any good suggestions? Thanks in advance. Best regards S?ren [[alternative HTML version deleted]]
Bert Gunter
2021-Dec-04 15:59 UTC
[R] Handling dependencies on Bioconductor packages for packages on CRAN
I suggest you post this on r-package-devel. That seems a better fit. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Dec 4, 2021 at 7:55 AM S?ren H?jsgaard <sorenh at math.aau.dk> wrote:> Dear all > > My gRbase package imports the packages from Bioconductor: graph, RBGL and > Rgraphviz > > If these packages are not installed, then gRbase can not be installed. The > error message is: > > ERROR: dependency ?graph? is not available for package ?gRbase? > > If I, prior to installation, run setRepositories and highlight 'BioC > software', then gRbase installs as it should, because the graph package > from Bioconductor is installed along with it. However, this extra step is > an obstacle to many users of the package which means that either people do > not use the package or people ask questions about this issue on stack > overflow, R-help, by email to me etc. It is not a problem to get the > package on CRAN because, I guess, the CRAN check machines already have the > three bioconductor packages installed. > > Therefore, I wonder if there is a way of specifying, in the DESCRIPTION > file or elsewhere, that these packages should be installed automatically > from bioconductor. > > An alternative would be if one could force the error message > > ERROR: dependency ?graph? is not available for package ?gRbase? > > to be accompanied by a message about what the user then should do. > > Any good suggestions? Thanks in advance. > > Best regards > S?ren > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Martin Morgan
2021-Dec-07 22:23 UTC
[R] Handling dependencies on Bioconductor packages for packages on CRAN
One possibility is to make graph a Suggests: dependency, and preface any code using it (or, e.g., in an .onLoad function) with if (!requireNamespace("graph", quietly = TRUE)) stop( "install the Bioconductor 'graph' package using these commands\n\n", ## standard Bioconductor package installation instructions " if (!requireNamespace('BiocManager', quiety = TRUE))\n", " install.packages('BiocManager')\n", " BiocManager::install('graph')\n\n" ) Use graph:: for any function used in the graph package. The code could be simplified if BiocManager were an Imports: dependency of your package -- it would already be installed. The 'Suggests:' dependency would not cause problems with CRAN, because Suggest'ed packages are available when the package is built / checked. The user experience of package installation would be 'non-standard' (didn't I just install gRbase??), so this is not an ideal solution. Martin ?On 12/4/21, 10:55 AM, "R-help on behalf of S?ren H?jsgaard" <r-help-bounces at r-project.org on behalf of sorenh at math.aau.dk> wrote: Dear all My gRbase package imports the packages from Bioconductor: graph, RBGL and Rgraphviz If these packages are not installed, then gRbase can not be installed. The error message is: ERROR: dependency ?graph? is not available for package ?gRbase? If I, prior to installation, run setRepositories and highlight 'BioC software', then gRbase installs as it should, because the graph package from Bioconductor is installed along with it. However, this extra step is an obstacle to many users of the package which means that either people do not use the package or people ask questions about this issue on stack overflow, R-help, by email to me etc. It is not a problem to get the package on CRAN because, I guess, the CRAN check machines already have the three bioconductor packages installed. Therefore, I wonder if there is a way of specifying, in the DESCRIPTION file or elsewhere, that these packages should be installed automatically from bioconductor. An alternative would be if one could force the error message ERROR: dependency ?graph? is not available for package ?gRbase? to be accompanied by a message about what the user then should do. Any good suggestions? Thanks in advance. Best regards S?ren [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.