pkg v0.1.1.9000

A Fresh Approach to Package Installation

The goal of 'pkg' is to make package installation faster and more reliable. In particular, it performs all HTTP operations in parallel, so metadata resolution and package downloads are fast. Metadata and package files are cached on the local disk as well. 'pkg' has a dependency solver, so it finds version conflicts before performing the installation. This version of 'pkg' supports CRAN, 'BioConductor' and 'GitHub' packages as well.



Manage Package Libraries

lifecycle Linux Build Status Windows Build status CRAN RStudio mirror downloads Coverage Status

pkg installs R packages from various sources.


Install the package from CRAN:


The second line creates pkg's own package library, to avoid interference between pkg's dependencies and the user's regular packages. Run this command any time to update pkg's package library.


Simply call pkg_install to install packages:

pkg::pkg_install("dplyr", lib = "/tmp/lib")

All dependencies will be installed as well, to the same library.


  • Make package installation cheaper and more reliable.

  • Cheaper, reliable package installation allows safer, more convenient workflows.


Speedy Features

  • Fast downloads and queries (all HTTP is concurrent).

  • Fast installs (package installations and builds are concurrent).

  • Package cache (all downloaded and locally built packages are cached).

  • Lazy downloads, only download metadata and package files if needed.

Safety features

  • Private library (pkg's own dependencies do not affect your "regular" packages and vice versa).

  • Do not load any package in the main process (except for pkg itself). Every operation runs in the sub-process, and the packages are loaded from the private library.

  • Dependency solver: makes sure that you end up in a consistent, working state of dependencies. Find conflicts up front, before actually installing anything.

  • Confirmation, warning for overwriting loaded packages.

  • Concurrency safe, locks library, locks caches. Lock is released when the process terminates.

Convenience features

  • GitHub packages.

  • BioC packages.

  • Show download sizes.


GPL-3 © RStudio

Functions in pkg

Name Description
local_install_deps Install the dependencies of a package tree
local_install_dev_deps Install all dependencies of a package tree
proj_status Status of packages in the project library
lib_status Status of packages in a ibrary
pkg_cleanup Clean up pkg caches and/or the pkg library
pkg_create_private_lib Install pkg's dependencies into its private library
local_install Install a package tree
proj_install Install project dependencies into the project library
proj_create Create a project that has a private package library
pkg_sitrep pkg SITuation REPort
pkg_remove Remove installed packages
pkg_install Install a package
proj_install_dev Install project dependencies, including dev dependencies into private project library
proj_remove Remove package(s) from a project
pkg_status Display installed locations of a package
No Results!


Include our badge in your README