A drawing of an elephant. Package Manager - Introduction

The Posit Package Manager is an application which can serve R package binaries on Linux. Two different variants exist:

The licensed variants (Base, Standard, Enterprise) have a different scope than the free version. While the public hosted version by Posit itself is essentially a mirror of CRAN which aims to provide R package binaries on Linux for the community, the licensed version aims to serve local packages for organizations which are not hosted on CRAN.

Local packages served by a private Package Manager can then be treated as if they were available on CRAN and installed via

install.packages(<local package>)

This is possible because a private Package Manager installation exposes packages via a CRAN-like URL which can be added to the default "repos" option in R which is used by install.packages().

A private installation of Package Manager cannot build binary packages as of now. This feature is planned for Q1 2023. Binaries are built centrally by Posit and synced to a local Package Manager installation. Local R packages are served as source packages.

Using the Public Package Manager by Posit

The public Package Manager by Posit is great for accessing R packages in any Linux environment. There are no costs involved and package installation is speeded up a lot, especially for packages which take a long time to compile because they contain C++ code or similar.

One can either go with the latest available package sources (e.g., for Ubuntu 20.04):

https://packagemanager.posit.co/cran/__linux__/focal/latest

or use a static snapshot from a given day

https://packagemanager.posit.co/cran/__linux__/focal/2022-05-18

It is already widely used in the R community. For example, the r-lib/actions project, which is the main driver for CI/CD in R when using GitHub Actions, uses the public Package Manager by Posit to install R package binaries in Linux environments.

We at cynkra also make use of the public Package Manager within our default product configuration. More details can be found in section “Package Manager snapshots”.

Using a private Package Manager Installation

Advantages of Using Package Manager

The advantages of a local Package Manager installation are shown in the “Additional Details” table at https://www.rstudio.com/products/package-manager/. The key points can be summarized as follows:

  • Package Manager provides a GUI interface for both users and admins to see all related metadata of a package (last updated, authors, available versions, etc.)
  • Package Manager allows to create a clean URL for a given subset of packages which can be added to the default "repos" option in R
  • Package Manager automatically builds new versions from a version control repository (e.g., Git) with a flexible choice of build triggers (e.g., commits, tags)
  • Control of build concurrency, history limit, download statistics
  • Package Manager is a sophisticated solution for serving R packages. This contrasts with community-driven efforts which require an additional web server to serve only a minimal skeleton of available packages with limited controls.

More information is provided in the FAQ section by Posit.

Curated CRAN Sources

Admins can use Package Manager to provide a curated subset of CRAN packages. This, in addition to “CRAN snapshot sources” might be of interest for organizations focused on full security and control of their R packages resources.

Additional capabilities: Python and Bioconductor

Package Manager is not only capable of serving R packages from CRAN but can also provide Biconductor packages and pypi libraries. This requires more than one Package Manager repo and hence at least the “Standard” license model. See the section on “Python and Pypi” or on the “Bioconductor source” in the Package Manager admin guide.