[R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Mar 16 15:42:39 CET 2023


В Thu, 16 Mar 2023 11:09:16 +0000
"Ruff, Sergej" <Sergej.Ruff using tiho-hannover.de> пишет:

> The Check-Function in R shows no Notes, Warnings or Errors, but I am
> not sure if that means that limma will install when installing my
> package from CRAN.

> Currently I am declaring limma like this:
> 
> Suggests:
> 
>     limma

install.packages() doesn't install suggested packages by default: the
`dependencies` argument defaults to NA, which means c("Depends",
"Imports", "LinkingTo"), which doesn't include 'Suggests'.

What if you pass dependencies = TRUE? Given the fact that Bioconductor
is absent from getOption('repos') by default, the package will still
not be installed. BiocManager::install() is the supported way to
install packages from Bioconductor:
https://cran.r-project.org/package=BiocManager/vignettes/BiocManager.html#installing-bioconductor-cran-or-github-packages

I think that BiocManager::install('YOUR_PACKAGE', dependencies = TRUE)
will install both your package and limma. It's a bit hard to verify
because your package should live in a repository, but if you'd like to
be sure, spin up a drat <https://CRAN.R-project.org/package=drat> repo
on a local server and add it to options(repos = ...) before trying to
install your package.

> Do I need to declare Bioconductor-dependencies such as Limma
> differently in the Description-File of my Package?
 
No, this is the right way to declare Bioconductor dependencies for CRAN
packages.

> Can CRAN identify that limma is a Bioconductor-Package and will it
> Limma install, when installing my package from CRAN?

The CRAN website will detect the Bioconductor dependency and highlight
it with a different colour, making it a link to the Bioconductor
website. See, e.g., the BiocManager package and its reverse
dependencies: https://CRAN.R-project.org/package=BiocManager

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list