Skip to content



BioConductor is a repository of R packages that facilitates rigorous and reproducible analysis of data from current and emerging biological assays.

BioConductor delivers releases where a set of packages is published at once and intended for compatibility only with a certain version of R. This is in contrast to CRAN where packages are added continuously with no reference to particular versions of R. Additionally, BioConductor also comes with its own installation tool, BiocManager::install().

Problem Statement#

Given the structural differences between BioConductor and CRAN repositories, it is not straightforward to work with both types. This applies to BioConductor package installation, especially when using renv, but also when publishing apps and documents on RStudio Connect that use BioConductor packages.

This document details various scenarios for working with BioConductor and its packages:

  • Installing BioConductor packages via BiocManager::install(), install.packages(), and via renv()
  • Publishing content to RStudio Connect that makes use of BioConductor packages


The following prerequisites are needed for the below to work:

  • A version of R installed
  • CRAN repository configured and reported by options()$repos
  • BiocManager package installed, either at user level or as part of the system default packages
  • Subsequently, any reference to "R profile" implies that the setting can be put either in (global setting) or .Rprofile (user or project level setting).

Installing and working with packages#

Public CRAN and BioConductor repositories#

The BioConductor way#

As per BioConductor, any BioConductor and CRAN package can be installed via


Publishing Shiny Apps that make use of BioConductor packages to RStudio Connect is not possible for this setup. BiocManager::install() temporarily adds the BioConductor repository for the duration of the install process. During the publishing process rsconnect no longer has any knowledge about BioConductor.

The CRAN way#

install.packages() by default is restricted to CRAN repositories only. BioConductor packages can be installed via install.packages() when setting

in the R profile.


The above setting is independent of the R version and will always use the most recent BioConductor release compatible with your R Version. Users that want to use a specific BioConductor release need to set this version as version parameter in BiocManager::repositories(), e.g. version="3.13".

Publishing Shiny Apps that make use of BioConductor packages to RStudio Connect is perfectly fine for this setup.

Using renv#

The general workflow is described on the renv webpage. By default renv::init() will only pick up packages from CRAN. In order to make it also use BioConductor packages, you need to add bioconductor=TRUE as a parameter, i.e.


which will use the most recent BioConductor release compatible with your R Version.


In case you would like to use a different BioConductor release, replace TRUE with the BioConductor version string, e.g. bioconductor="3.13".

Any renv initialised in such a way can be restored with renv::restore() and only uses the information in renv.lock. Users that are interested in the details will realise that the BioConductor version is defined in renv.lock, e.g.

  "Bioconductor": {
    "Version": "3.14"

Publishing Shiny Apps that make use of BioConductor packages to RStudio Connect will only work if you again add


to your R profile.

Public RSPM#

The public RStudio Package Manager (RSPM) is a service provided by RStudio. It mirrors both CRAN and BioConductor repositories. In addition it provides time-based snapshots for CRAN similar to MRAN but in addition offers package binaries for many Enterprise Linux distributions. Additionally the repository URLs can be made immutable against any future change in package metadata for maximum reproducibility.

In order to use CRAN and BioConductor packages from public RSPM, you will need to point both the CRAN repo definition and the BioConductor mirror to the one from public RSPM via

options(BioC_mirror = "")

in your R profile. The above will make the latest package versions from CRAN and BioConductor available.

Use of time-based CRAN snapshots#

Time-based snapshots can be used for increased reproducibility, especially in environments where the users do not make use of renv for fixing their R package versions. By setting a time-based snapshot, any R package installation without a specific package version definition will install the most recent version available at the given snapshot. Such snapshots and their respective URL can be selected by clicking on a calendar date in the Section "Repository URL" of the "Setup" page for CRAN and selecting "Freeze". For the snapshot of Nov 26th, 2021, the URL is "".

If time-based CRAN snapshots are used, it is advisable to set the dates to a time when the BioConductor version compatible]( with the R version was released to ensure compatibility.

Immutability/Lock of of CRAN Package Data#

In addition to plain time-based snapshots, the package data available for a given date can be locked against future changes by selecting "Lock Package Data" in the "Repository URL" section of the Setup Page for the CRAN repo. For Nov 26th, 2021, the URL is "".

This feature ensures reproducibility even if changes are made in RStudio Package Manager, for example a change to the database scheme. Further information can be found in the RStudio Package Manager Admin Guide.

Private RSPM#

If a private RSPM is used, the largest flexibility is possible. The only required change compared to using public RSPM is the hostname.

Additional capabilities come into play via the creation of custom CRAN-like repositories that can mix BioConductor releases with latest or time-based snapshots of CRAN.

The basic idea is to create a repo that is subscribed to both an appropriate BioConductor release and CRAN. Additional package sources (e.g. local, git based) can be subscribed to this repo, too. The benefit of this solution is that the newly created repo can be used with snapshots.

More details on this approach are in the RSPM admin guide and in the RSPM Quickstart.

Once such a setup is in place, this custom repo only can be set in the repo definition using the same approach as outlined for public RSPM - only install.packages() or renv::install() can be used. The use of BiocManager::install() is no longer needed.

For a custom repo named "bioconductor-3.14" that contains both latest CRAN and BioConductor release 3.14, the appropriate repo setting would be

where hostname-of-private-rspm corresponds to the DNS name of your local/private RSPM.


  • Working with BioConductor packages for code development is possible
    • in the absence of RSPM for all scenarios described, e.g.
    • If RSPM is used, additionally Bioc_Mirror needs to be set and pointed to the respective URL of the bioconductor repository
    • For private RSPM and the usage of the "CRAN like" repository that includes both CRAN and BioConductor repos only this single combined repository needs to be defined in the R profile.
  • Publishing to RStudio Connect is possible
    • in the absence of RSPM only using the CRAN way and renv(), i.e. when persistently defining the BioConductor repositories in the R profile.
    • in the presence of RSPM for any of the described uses.