Search code examples
rcranbioconductor

Installing R-package from CRAN does not include Bioconductor packages


I have an R-package on CRAN. When I install it, using install.packages("mypackage"), I get the warning message Warning in install.packages : dependencies ‘x’, ‘y’ are not available, with x and y being packages on Bioconductor. This leads to functions in my package using functions from x and y not working.

This problem seem to have appeared out of nowhere (maybe when I updated my own R-version?), and only affects Bioconductor Imports, not CRAN Imports. Packages x and y are perfectly functional, and if I install them separately using BiocManager::install(c("x", "y")) my package works as it should. My package passes all checks in CRAN. As suggested here I have biocViews: in my package DESCRIPTION. After some research, my best guess is that maybe the problem is due to mismatches between R and Bioconductor releases, as described here, although I have to say, I don't fully understand this.

Any ideas on why I have this problem, and how to fix it? Currently, my best solution is to add instructions to the readme that the Bioconductor packages may need to be downloaded separately, but that is not an optimal solution.


Solution

  • Try using BiocManager to install the CRAN package, as it can install both CRAN and bioconductor packages:

    BiocManager::install("mypackage")