manager {bspm}R Documentation

Manage Packages from System Repositories

Description

Talk to the system package manager to install/remove... packages from system repositories (see details for further options).

Usage

install_sys(pkgs)

remove_sys(pkgs)

discover()

Arguments

pkgs

character vector of names of packages.

Details

If R runs with root privileges (e.g., in a docker container), these functions talk directly to the system package manager. Regular users are also able to install/remove packages without any administrative permission via the accompanying D-Bus service if bspm is installed as a system package. If not, these methods fall back on using sudo to elevate permissions (or pkexec in GUIs such as RStudio) in interactive sessions. Note that, if you want to fall back to sudo in a non-interactive session, you need to set options(bspm.sudo=TRUE).

By default, if a package is not available in the system repositories, it is installed from R's configured repositories along with all its dependencies. This behavior can be changed via options(bspm.always.install.deps=TRUE), which tries to install from system repositories recursive dependencies of those packages that are not available. For example, if A depends on B, and B is available in the system repositories but A is not, then only A will be installed from CRAN with this option enabled, and both will be installed from CRAN with this option disabled (default).

The discover method is only needed when e.g. a new repository is added that contains packages with different prefixes (for example, your system repositories may provide packages called r-cran-* and r-bioc-* and then you add a new repository that provides packages called r-github-*). Otherwise, it will not have any effect besides regenerating the internal configuration files.

Value

Functions install_sys and remove_sys return, invisibly, a character vector of the names of packages not available in the system.

See Also

integration

Examples

## Not run: 
# install 'units' and all its dependencies from the system repos
bspm::install_sys("units")

# now remove it
bspm::remove_sys("units")

## End(Not run)


[Package bspm version 0.3.7 Index]