Learn R Programming

pkg

Manage Package Libraries

pkg installs R packages from various sources.

Installation

Install the package from CRAN:

install.packages("pkg")
pkg::pkg_create_private_lib()

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.

Usage

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.

Goals

  • Make package installation cheaper and more reliable.

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

Features

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.

License

GPL-3 © RStudio

Copy Link

Version

Version

0.1.1.9000

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

February 4th, 2019

Functions in pkg (0.1.1.9000)

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