rig pkg
Tools for R packages.
Subcommands
available- List packages available in the R package repositories
deps- Dependencies of a package in the repositories
doctor- Find problems with the packages in a library
info- Information about a package in the repositories
install- Install packages from the repositories
list-
Packages installed in a library (alias:
ls) remove-
Remove packages from a library (alias:
rm) search- Search for CRAN packages
tree- Dependency tree of a package in the repositories
rig pkg available
List the packages available from the repositories configured for the R version, ordered by name, using the latest version of each package. For each package rig shows its version and its number of hard dependencies (Depends, Imports and LinkingTo, excluding R and the base packages).
Repositories
rig uses the repositories configured for the R version, i.e. the rig repos list output for the default R version, or for the one selected with --r-version. If two repositories have the same version of a package, the one listed first wins.
--with-repos (or --index) and --without-repos (or --no-index) change the repositories for this command only, the setup of the R version stays the same. Both take a comma-separated list and can be repeated. --with-repos adds repositories, by name, like rig repos enable, by URL, or as name=URL, e.g. --index=rlib=https://r-lib.r-universe.dev. A repository given by URL is a CRAN-like repository and comes before the others. --without-repos=<names> leaves out repositories, and --without-repos without names leaves out all configured repositories, so only the ones in --with-repos are used, e.g. --no-index --index=https://r-lib.r-universe.dev. URLs cannot contain commas.
For P3M and for Bioconductor’s software repository rig reads their full package history, from https://ppm.r-pkg.org and https://ppm-bioc.r-pkg.org, so older and archived versions are available, too. Any other repository, e.g. CRAN itself, an r-universe, or one added with rig repos add, is read from its PACKAGES files, so only its current packages are available. If the Bioconductor repositories are enabled, the list includes the packages of the Bioconductor release of the R version, e.g. Bioconductor 3.23 for R 4.6. Without any R version rig lists CRAN, and the newest Bioconductor release.
Packages CRAN or Bioconductor has archived are omitted by default; pass --include-archived to list them as well.
Use --json to print the full listing as JSON, including the complete dependency lists for every package. See rig pkg info for a detailed view of a single package, and rig pkg info --versions to list all versions of a package.
Usage
rig pkg available [OPTIONS]
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
-h, --help- Print help (see a summary with ‘-h’)
--include-archived- Also list packages CRAN has archived
--json- JSON output
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version whose repositories to use, instead of the default
--user- Run in user mode (overrides RIG_MODE and config)
--with-repos <REPOS>- Also use these repositories, a comma-separated list of repository names, URLs or name=URL pairs. Can be repeated. [aliases: index]
--without-repos[=<REPOS>]-
Do not use these repositories, a comma-separated list. Without a value, do not use any of the configured repositories, only the ones in
--with-repos. Can be repeated. [aliases: no-index]
rig pkg deps
Show what a package needs, in a table: every package it depends on, the latest version of that package in the repositories, the dependency type (Depends, Imports, LinkingTo) and the version requirement, if it has one.
By default the dependencies of the latest version of the package are shown; use --version to ask about a specific one, including versions that CRAN has archived. Use --json for machine readable output.
Repositories
rig uses the repositories configured for the R version, i.e. the rig repos list output for the default R version, or for the one selected with --r-version. If two repositories have the same version of a package, the one listed first wins.
--with-repos (or --index) and --without-repos (or --no-index) change the repositories for this command only, the setup of the R version stays the same. Both take a comma-separated list and can be repeated. --with-repos adds repositories, by name, like rig repos enable, by URL, or as name=URL, e.g. --index=rlib=https://r-lib.r-universe.dev. A repository given by URL is a CRAN-like repository and comes before the others. --without-repos=<names> leaves out repositories, and --without-repos without names leaves out all configured repositories, so only the ones in --with-repos are used, e.g. --no-index --index=https://r-lib.r-universe.dev. URLs cannot contain commas.
For P3M and for Bioconductor’s software repository rig reads their full package history, from https://ppm.r-pkg.org and https://ppm-bioc.r-pkg.org, so older and archived versions are available, too. Any other repository, e.g. CRAN itself, an r-universe, or one added with rig repos add, is read from its PACKAGES files, so only its current packages are available. Bioconductor packages are included if the Bioconductor repositories are enabled for the R version.
Dependency types
By default rig lists the hard dependencies only: Depends, Imports and LinkingTo, i.e. the packages that need to be installed to use the package. --dev adds the soft dependencies, Suggests and Enhances, which are typically only needed to run the tests, build the vignettes or use some optional feature.
R itself and the base packages are listed if the package depends on them, with their version requirement, but without a version of their own, as they are part of R.
--recursive (-r) shows the whole dependency closure. Each package appears once, with the Depth column giving its distance from the queried package, and the Needed by column naming the packages that pull it in.
See rig pkg tree for a visual dependency tree.
rig follows the dependencies of the latest version of every package in the tree, so a version requirement that would force an older version, with different dependencies, is not taken into account. Use rig proj lock for a resolution that is consistent across versions.
Usage
rig pkg deps [OPTIONS] <package>
Arguments
<package>- package to show the dependencies of
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
--dev- Include dev (development) dependencies
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--r-version <r-version>- R version whose repositories to use, instead of the default
-r, --recursive- Show recursive (transitive) dependencies
--user- Run in user mode (overrides RIG_MODE and config)
-v, --version <version>- package version to use (default: latest)
--with-repos <REPOS>- Also use these repositories, a comma-separated list of repository names, URLs or name=URL pairs. Can be repeated. [aliases: index]
--without-repos[=<REPOS>]-
Do not use these repositories, a comma-separated list. Without a value, do not use any of the configured repositories, only the ones in
--with-repos. Can be repeated. [aliases: no-index]
rig pkg doctor
Check the packages installed in an R package library, and report the ones that may not work: missing dependencies, dependencies that are too old, and packages compiled against another version of a LinkingTo dependency than the one installed now. This command does not start R.
Example output:
3 problems (2 errors, 1 warning) in 312 packages (R 4.4.1, main: /Users/johndoe/Library/R/arm64/4.4/library)
Package Version Severity Problem Details
---------------------------------------------------------------------------
foo 1.0.0 error missing Imports bar, not installed
glue 1.8.0 error version Imports cli (>= 3.6.0), 3.4.1 is installed
qux 2.1.0 warning built-r built for R 4.3.3, R 4.4.1 is used
To fix the errors, run:
rig pkg install bar cli
To fix the warnings, run:
rig pkg install qux
Give package names to report on those packages only. They are still checked against the whole library.
After the table rig prints the commands that fix the problems it can fix: rig pkg install for missing and too old dependencies and for packages that need a reinstall, and the commands that remove leftover lock directories and broken packages. The r-version and name problems need to be fixed by hand.
rig exits with a non-zero status if it finds an error. Warnings alone do not change the exit status. Use --json for machine readable output: an array with one object per problem.
Checks
Errors:
missing: aDependsorImportsdependency is not installed.version: aDependsorImportsdependency is installed, but its version does not satisfy the requirement of the package.r-version: the package needs another R version, according to itsDepends: R (...)requirement.abi: the package was compiled against another version (or another build) of aLinkingTodependency than the one installed now. rig can only tell this for packages it installed itself, becauserig pkg installrecords what a package was compiled against.
Warnings:
stale: only with--stale, see below.built-r: the package was built for another R minor version, e.g. for R 4.3.x in an R 4.4.x library.platform: the package was built for another architecture, e.g.x86_64instead ofaarch64.name: thePackagefield of theDESCRIPTIONfile does not match the directory the package is installed in.lock: a00LOCK*directory, left behind by an interrupted installation.broken: a directory without a readableDESCRIPTIONfile, or a package whose dependencies cannot be parsed.sysreqs: Linux only. OS packages that the package needs, according to itsSystemRequirementsfield, are not installed. See below.
--dev also checks the Suggests and Enhances dependencies. A missing or too old Suggests or Enhances dependency is a warning. Suggests are typically only needed for tests, vignettes or optional features. An Enhances dependency that is too old may break the parts of the package that work with it.
--stale also checks LinkingTo ABI compatibility for the packages that rig did not install, so it has no record of what they were compiled against. For these rig compares the Built timestamps, and warns if a LinkingTo dependency was built after the package itself, because then the package may need a reinstall. This is off by default, because it flags many packages that are fine: binary packages from CRAN are not rebuilt when a LinkingTo dependency changes on some platforms.
LinkingTo dependencies are only needed to install a package, so a LinkingTo dependency that is not installed is not a problem, unless the package also needs it in Depends or Imports.
Dependencies are looked up in the library first, then in the system library of the R version, which holds the base and recommended packages. The base packages always count as installed.
System requirements
On Linux rig matches the SystemRequirements field of each package against the r-system-requirements rules for your distribution, the same way rig pkg install does, and reports the OS packages that are not installed. After the table it prints the command that installs them.
This is a warning, not an error. The rules name the development packages, e.g. libcurl4-openssl-dev, which a package needs to compile from source. An installed package usually only needs the runtime library, e.g. libcurl4, so it may work fine without them, but it cannot be reinstalled from source.
A manylinux binary package bundles the libraries it needs, so rig does not check its system requirements. Set the sysreqs config entry to false to turn this check off.
Which library
--r-version (-r) checks the library of another R version, instead of the default one.
--library (-l) selects a non-default library. It takes either the name of a library of the R version, see rig library list , or the path of a library directory. A library name is tried first, so prefix a relative path with ./ (or use an absolute path) if it happens to share a name with a library.
A library given as a path does not belong to an R version, so rig checks it against the R version --r-version names, or else the default R version, and tells you which one it uses. Without --r-version and a default R version, rig skips the checks that need an R version (r-version, built-r, platform) and the system library.
Usage
rig pkg doctor [OPTIONS] [package]...
Arguments
[package]...- packages to report on (default: all)
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
--dev- Also check the Suggests and Enhances dependencies
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
-l, --library <library>- Library name or path, instead of the default library
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version to operate on, instead of the default
--stale- Warn about packages that rig did not install, if a LinkingTo dependency was built after them
--user- Run in user mode (overrides RIG_MODE and config)
rig pkg info
Show information about a package in the repositories configured for the R version, from its DESCRIPTION file.
By default the latest available version is shown; use --version to select a specific one, including versions that CRAN has archived. Use --json to print all DESCRIPTION fields.
Repositories
rig uses the repositories configured for the R version, i.e. the rig repos list output for the default R version, or for the one selected with --r-version. If two repositories have the same version of a package, the one listed first wins.
--with-repos (or --index) and --without-repos (or --no-index) change the repositories for this command only, the setup of the R version stays the same. Both take a comma-separated list and can be repeated. --with-repos adds repositories, by name, like rig repos enable, by URL, or as name=URL, e.g. --index=rlib=https://r-lib.r-universe.dev. A repository given by URL is a CRAN-like repository and comes before the others. --without-repos=<names> leaves out repositories, and --without-repos without names leaves out all configured repositories, so only the ones in --with-repos are used, e.g. --no-index --index=https://r-lib.r-universe.dev. URLs cannot contain commas.
For P3M and for Bioconductor’s software repository rig reads their full package history, from https://ppm.r-pkg.org and https://ppm-bioc.r-pkg.org, so older and archived versions are available, too. Any other repository, e.g. CRAN itself, an r-universe, or one added with rig repos add, is read from its PACKAGES files, so only its current packages are available.
rig shows the full DESCRIPTION file for a package version from P3M, and for the current version of a Bioconductor package, from the VIEWS file of its Bioconductor repository (software, annotation, experiment data, workflows or books). For a package version from any other repository, and for an older Bioconductor version, rig only knows the fields of the repository’s index: its version, its dependencies and where to download it.
README of a package
--readme prints the README of the package, instead of its metadata, exactly as the repository stores it, i.e. not rendered and not paged. It works together with --version, to get the README of an older version, but not with --versions.
--readme --json prints an object with the package and version the README belongs to, the readme itself, and the format it is written in. The format is the one the repository reports, e.g. md for markdown or txt for plain text.
A package without a README is not an error. --readme then prints nothing, and --readme --json prints null for both readme and format.
All versions of a package
--versions lists all versions of the package ever published on CRAN, oldest first, and the current versions in the other repositories. It cannot be combined with --version.
--versions --json prints the full DESCRIPTION of every version, each with an extra Archived field for an archived package.
Usage
rig pkg info [OPTIONS] <package>
Arguments
<package>- package to show
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version whose repositories to use, instead of the default
--readme- Show the README of the package, instead of its metadata
--user- Run in user mode (overrides RIG_MODE and config)
-v, --version <version>- package version to show (default: latest)
--versions- List all versions of the package, instead of the details of one
--with-repos <REPOS>- Also use these repositories, a comma-separated list of repository names, URLs or name=URL pairs. Can be repeated. [aliases: index]
--without-repos[=<REPOS>]-
Do not use these repositories, a comma-separated list. Without a value, do not use any of the configured repositories, only the ones in
--with-repos. Can be repeated. [aliases: no-index]
rig pkg install
Install one or more R packages, and everything they need, into an R package library.
rig resolves the whole dependency tree first, the same way rig proj lock does for a project, so a package is only installed if every package it needs can be installed with it, at versions that work together. --dry-run runs the resolution and reports what it would install, without installing anything.
Repositories
rig installs from the repositories configured for the R version, i.e. the rig repos list output for the default R version, or for the one selected with --r-version. If two repositories have the same version of a package, the one listed first wins.
--with-repos (or --index) and --without-repos (or --no-index) change the repositories for this command only, the setup of the R version stays the same. Both take a comma-separated list and can be repeated. --with-repos adds repositories, by name, like rig repos enable, by URL, or as name=URL, e.g. --index=rlib=https://r-lib.r-universe.dev. A repository given by URL is a CRAN-like repository and comes before the others. --without-repos=<names> leaves out repositories, and --without-repos without names leaves out all configured repositories, so only the ones in --with-repos are used, e.g. --no-index --index=https://r-lib.r-universe.dev. URLs cannot contain commas.
For P3M and for Bioconductor’s software repository rig reads their full package history, from https://ppm.r-pkg.org and https://ppm-bioc.r-pkg.org, so older and archived versions are available, too. Any other repository, e.g. CRAN itself, an r-universe, or one added with rig repos add, is read from its PACKAGES files, so only its current packages are available.
A CRAN-like repository has binary packages for macOS and Windows, if it has PACKAGES files for them in the standard place, e.g. bin/macosx/big-sur-arm64/contrib/4.5. On Linux it has source packages only.
Bioconductor packages
rig installs Bioconductor packages if the Bioconductor repositories are enabled for the R version, see rig repos enable, from the Bioconductor release of the R version, e.g. Bioconductor 3.23 for R 4.6. Then rig pkg install limma works like rig pkg install dplyr. R_BIOC_VERSION selects another Bioconductor release. See “Bioconductor packages” in rig proj lock.
Git, GitHub, GitLab and URL sources
A package can also be given straight from a git repository, pak’s package reference syntax, the same one rig proj add accepts:
rig pkg install r-lib/crayon
rig pkg install r-lib/crayon@84be6207
rig pkg install r-lib/crayon@some-branch
rig pkg install r-lib/crayon#41
rig pkg install r-lib/crayon@*release
rig pkg install gitlab::group/project@main
rig pkg install 'git::https://gitlab.com/example/pkg.git@main'
rig pkg install https://cran.rstudio.com/src/contrib/processx_3.9.0.tar.gz
A bare <owner>/<repo> (optionally github::<owner>/<repo>) is a GitHub reference; <owner>/<repo>/<subdir> points at a package in a subdirectory of the repository. After the path, @<ref> pins a branch, tag or commit, #<pr> a pull request, and @*release the latest release.
gitlab::<group>/<project> is the same idea for GitLab, including nested subgroups (gitlab::<group>/<subgroup>/<project>); @<ref> pins a branch, tag or commit, and /-/<subdir> points at a subdirectory. Merge requests and @*release are not supported for GitLab. A self-hosted instance is gitlab::<https-url-of-group-and-project>, e.g. gitlab::https://gitlab.example.com/group/project.
A git::<url> reference works with any git host, not only GitHub or GitLab.
url::<https-url> (or a bare <https-url>) points straight at a package source archive.
The package name is read from the fetched repository’s (or archive’s) own DESCRIPTION (which may differ from the repository name); the dependency is pinned to an exact commit, or to the archive’s sha256 for a url:: source, resolved right away, not to a version range.
rig fetches a git/GitHub/GitLab source with the system git, which must be installed and on PATH. A private repository authenticates exactly the way a plain git clone would on your machine: a configured credential helper (Keychain, Windows Credential Manager, git credential-store, etc.), .netrc, an SSH agent, or credentials already embedded in the URL. There is no separate rig-specific token setting. A url:: source is a plain HTTP(S) download and needs no such authentication.
Local paths
A package that is already on this machine is installed from where it is:
rig pkg install .
rig pkg install ./mypkg
rig pkg install ../mypkg
rig pkg install ~/works/mypkg
rig pkg install /opt/src/mypkg
rig pkg install mypkg_1.0.0.tar.gz
rig pkg install local::mypkg
A path can be a package source directory or a package file: a source tarball (.tar.gz), or a binary package built by R CMD INSTALL --build (.tgz on macOS and Linux, .zip on Windows). A source directory or tarball is installed with R CMD INSTALL, a binary is unpacked into the library directly.
An argument counts as a path when it is . or .., starts with ./, ../, ~/ or / (on Windows also .\, ..\, \ or a drive letter), or is the name of a package file that exists. The local:: prefix forces a path, whatever it looks like.
Installing only the dependencies
--no-install-project installs the dependencies of the named packages, but not the named packages themselves, e.g. to set up a library for working on a package from its source directory:
rig pkg install --no-install-project --dev .
A named package is still installed if another package that is being installed depends on it.
Dev dependencies
By default rig installs the hard dependencies only: Depends, Imports and LinkingTo, i.e. the packages that need to be installed to use the package. --dev also installs the soft dependencies, Suggests and Enhances, which are typically only needed to run the tests, build the vignettes or use some optional feature.
A package sometimes has dev dependencies that are not in the repositories rig installs from. Those cannot be installed, and by default rig reports them and errors. See --ignore-unavailable to ignore them.
Binary and source packages
A binary package is a package that has already been built for your platform and R version. Installing one is unpacking it into the library, so rig does that itself and never starts R.
A package with no binary build is installed from its source tarball, with R CMD INSTALL, which does start R, and needs whatever that package needs to compile. The output of the compilation goes into a log file per package, in a _logs directory inside the library, and rig points at the log when an installation fails.
--platform installs for a platform other than this machine’s, e.g. --platform x86_64-unknown-linux-gnu-ubuntu-24.04 (see rig system detect-platform for the platform strings rig takes), and --platform source installs source packages only.
--prefer-binary trades a newer version for an older one that has a binary build, which is useful when compiling is expensive; it takes the number of versions to look back through, e.g. --prefer-binary=5, and defaults to 3.
System requirements
On Linux, many R packages need system libraries and tools, e.g. libcurl for the curl package, and a source package needs their development files to compile. A package lists these in the SystemRequirements field of its DESCRIPTION. Before installing, rig matches this field against the r-system-requirements rules for your Linux distribution, checks which of the needed OS packages are installed already, and installs the missing ones with the distribution’s package manager (apt-get, dnf, yum, zypper or apk).
This is only needed for source packages and for binaries built for one distribution. A manylinux binary has its libraries built in, so rig does not look at its system requirements. On macOS and Windows there are no system requirements to install.
rig installs the OS packages itself if it runs as root, or if sudo works without a password. Otherwise it prints the commands that would install them, and carries on: the R packages may still install, and if one fails, rig names the system packages it was missing. This is the same in admin mode and in user mode: OS packages always need administrator rights, even if rig does not need them for anything else.
--no-sysreqs turns this off for one run, and --sysreqs turns it on even if the sysreqs config entry turns it off. With --dry-run, rig shows the missing OS packages and the commands, and installs nothing. Set the sysreqs config entry to print to always only show them. See rig config for the sysreqs, sysreqs-sudo, sysreqs-update and sysreqs-rules-url entries.
Excluding newer package versions
--exclude-newer ignores CRAN and Bioconductor package versions published after a date, e.g. --exclude-newer 2025-06-01, or after a span back from today, e.g. --exclude-newer "7 days". See rig proj lock for the accepted formats and details. The PACKAGES files of other repositories have no publication dates, so their versions are never excluded.
Caching package builds
rig caches the packages that it compiles and uses it in subsequent installations to avoid recompiling the same package. A locally build cached binary belongs to a specific platform, minor R version, source package, set of versions of the packages it is compiled against, and set of ~/.R/Makevars files. Change any of those and the package is compiled again.
--no-cache turns all of this off for one run: rig then downloads the repository metadata and the package files again, compiles every source package rather than unpacking one it built earlier, and adds nothing to the cache. See rig config .
Skipping already installed packages
rig does not install a package that is already installed and up to date, so running the same command twice does nothing the second time.
rig makes sure that installed packages are ABI compatible and reinstalls packages as needed to make sure that a package with LinkingTo dependencies is build against the installed version of those dependencies.
rig may reinstall more packages than needed if cannot determine LinkingTo compatibility of an installed package, typically this happens if that package was not installed with rig.
Use --reinstall to installs everything in the resolution.
Which library
By default rig installs into the default library of the default R version, i.e. the library that rig library default reports, and the one R installs packages into.
--library (-l) selects another library. It takes either the name of a library of the R version, as rig library list prints them, or the path of a library directory. A library name is tried first, so prefix a relative path with ./ (or use an absolute path) if it happens to share a name with a library:
rig pkg install --library myproject cli
rig pkg install --library /usr/lib/R/site-library cli
--r-version (-r) selects the library of another R version, instead of the default one, as it does for the rig library commands.
In admin mode the site and system libraries of an R installation belong to the administrator, so installing into them needs sudo (an administrator account on Windows). Your own user library never does.
Usage
rig pkg install [OPTIONS] <package>...
Arguments
<package>...- packages to install
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
--dev- Include dev (development) dependencies
--dry-run- Show what would be installed, install nothing
--exclude-newer <DATE>- Ignore package versions published after this date. A date (2025-06-01), an RFC 3339 timestamp, or a span back from today (7 days, 2 weeks, P1M). Not before 2017-10-10.
-h, --help- Print help (see a summary with ‘-h’)
--ignore-unavailable- Skip dev dependencies that are not available in the repositories, instead of failing
--json- JSON output
-l, --library <library>- Library name or path, instead of the default library
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--no-install-project- Do not install the packages named on the command line, only their dependencies. A named package is still installed if another package that is installed depends on it.
--no-sysreqsLinux only- Do not install the system packages the R packages need
--platform <platform>-
Platform to install binary packages for, e.g. macos, windows, ubuntu-24.04, or a full platform string like aarch64-unknown-linux-gnu-ubuntu-24.04 (default: this machine). Use
--platformsource to install source packages only. --prefer-binary[=<prefer-binary>]-
Prefer an older version that has a binary package over a newer one that does not. Optionally give how many of the newest versions to consider, e.g.
--prefer-binary=5(default: 3). -r, --r-version <r-version>- R version to operate on, instead of the default
--reinstall- Install the packages even if they are already up to date
--sysreqsLinux only- Install the system packages the R packages need, even if the sysreqs setting turns this off
--user- Run in user mode (overrides RIG_MODE and config)
--with-repos <REPOS>- Also use these repositories, a comma-separated list of repository names, URLs or name=URL pairs. Can be repeated. [aliases: index]
--without-repos[=<REPOS>]-
Do not use these repositories, a comma-separated list. Without a value, do not use any of the configured repositories, only the ones in
--with-repos. Can be repeated. [aliases: no-index]
rig pkg list
Alias: rig pkg ls
List the packages installed in an R package library. This command does not start R.
Example output:
312 packages (R 4.4.1, main: /Users/gaborcsardi/Library/R/arm64/4.4/library)
Package Version Built Platform Source
-----------------------------------------------------------------------------
cli 3.6.3 4.4.0 aarch64-apple-darwin20 CRAN
glue 1.8.0 4.4.1 aarch64-apple-darwin20 CRAN
asciicast 2.3.1.9000 4.4.1 aarch64-apple-darwin20 github::r-lib/asciicast
mypkg 0.0.1 4.4.1 - -
Platform is - for a package without compiled code. Use --json for machine readable output, which reports the repository or remote type as source and the remote itself as remote, separately, instead of Source.
--library (-l) selects a non-default library. It takes either the name of a library of the R version, see rig library list , or the path of a library directory. A library name is tried first, so prefix a relative path with ./ (or use an absolute path) if it happens to share a name with a library.
--r-version (-r) lists the library of another R version, instead of the default one.
Usage
rig pkg list [OPTIONS]
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
-l, --library <library>- Library name or path, instead of the default library
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version to operate on, instead of the default
--user- Run in user mode (overrides RIG_MODE and config)
rig pkg remove
Alias: rig pkg rm
Delete one or more installed packages from an R package library. This command does not start R.
rig does not check whether another installed package needs the one being removed.
The base packages that ship with R (base, stats, utils, …) are part of the R installation, and R does not work without them, so rig refuses to remove them unless --force is also given.
Which library
--library (-l) selects a non-default library. It takes either the name of a library of the R version, see rig library list , or the path of a library directory. A library name is tried first, so prefix a relative path with ./ (or use an absolute path) if it happens to share a name with a library.
--r-version (-r) lists the library of another R version, instead of the default one.
In admin mode the site and system libraries of an R installation belong to the administrator, so removing a package from them needs sudo (an administrator account on Windows). Your own user library never does. To remove a whole library, with all the packages in it, use rig library rm instead.
Usage
rig pkg remove [OPTIONS] <package>...
Arguments
<package>...- packages to remove
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
--force- Remove base packages as well, which R itself needs
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
-l, --library <library>- Library name or path, instead of the default library
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version to operate on, instead of the default
--user- Run in user mode (overrides RIG_MODE and config)
rig pkg search
Search CRAN packages by name, title, description, author and maintainer. The search runs on the web service of the pkgsearch R package, https://search.r-pkg.org, so it gives the same results as pkgsearch::pkg_search(), and it needs network access. It always searches CRAN, not the repositories configured with rig repos. This command does not start R.
Packages that match all search terms, or the whole phrase, rank higher, and packages with more reverse dependencies rank higher, too.
Example output:
- "permutation test" ------------------------- 3431 packages in 0.023 seconds -
1 coin @ 1.4-5 (score 100) Torsten Hothorn, 3 months ago
--------------
# Conditional Inference Procedures in a Permutation Test Framework
Conditional inference procedures for the general independence problem
including two-sample, K-sample (non-parametric ANOVA), correlation,
censored, ordered and multivariate problems described in
<doi:10.18637/jss.v028.i08>.
https://codeberg.org/thothorn/coin/
2 exactRankTests @ 0.8-37 (score 33) Torsten Hothorn, 5 months ago
-------------------------
# Exact Distributions for Rank and Permutation Tests
Computes exact conditional p-values and quantiles using an
implementation of the Shift-Algorithm by Streitberg & Roehmel.
...
Next 8 results: rig pkg search "permutation test" --from 9
With --short (-s) every package takes a single line:
- "permutation test" ------------------------- 3431 packages in 0.017 seconds -
# package version by @ title
1 100 coin 1.4-5 Torsten Hothorn 3M Conditional Infer...
2 33 exactRankTests 0.8-37 Torsten Hothorn 5M Exact Distributio...
3 33 lmPerm 2.1.6 Marco Torchiano 10M Permutation Tests...
...
Next 20 results: rig pkg search "permutation test" --from 21 --short
The score of a package is a percentage of the score of the best match. The long format shows it after the version, the short format in the unnamed second column. The @ column is the time since the package was last released.
Multiple words are searched together, so rig pkg search permutation test is the same as rig pkg search "permutation test".
--size (-n) sets the number of results to show, the default is 8, or 20 with --short. --from shows results starting from this rank, e.g. --from 9 shows the second page of results in the long format. If there are more results, the last line of the output shows the command that prints the next page.
--json prints the results in JSON, including more fields: the maintainer’s email address, the number of reverse dependencies, the number of downloads in the last month, the license, the URLs and the bug report URL.
In a terminal, the output is shown through a pager: $RIG_PAGER, $PAGER or less, in this order. Set RIG_PAGER to cat to turn this off.
Usage
rig pkg search [OPTIONS] <query>...
Arguments
<query>...- search terms
Options
--from <from>- Rank of the first result to show [default: 1]
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-s, --short- Short output, one line per package
-n, --size <size>-
Number of results to show [default: 8, or 20 with
--short]
rig pkg tree
Show everything a package needs, directly or indirectly, as a tree:
dplyr 1.1.4 — 13 direct, 30 total
├── R (>= 3.5.0) [D]
├── cli 3.6.4 (>= 3.4.0)
│ ├── R (>= 3.4) [D]
│ └── utils
├── lifecycle 1.0.4 (>= 1.0.3)
│ ├── cli 3.6.4 (>= 3.4.0) (*)
│ └── rlang 1.1.6 (>= 1.1.0)
│ └── R (>= 3.5.0) [D]
└── vctrs 0.6.5 (>= 0.6.4)
└── cpp11 0.5.2 [L]
[Suggests]
└── tidyr 1.3.1 (>= 1.3.0)
└── cpp11 0.5.2 (>= 0.4.0) [L] (*)
Each line of the tree below names a package, its latest version in the repositories, and the version requirement it is needed with, if it has one.
Repositories
rig uses the repositories configured for the R version, i.e. the rig repos list output for the default R version, or for the one selected with --r-version. If two repositories have the same version of a package, the one listed first wins.
--with-repos (or --index) and --without-repos (or --no-index) change the repositories for this command only, the setup of the R version stays the same. Both take a comma-separated list and can be repeated. --with-repos adds repositories, by name, like rig repos enable, by URL, or as name=URL, e.g. --index=rlib=https://r-lib.r-universe.dev. A repository given by URL is a CRAN-like repository and comes before the others. --without-repos=<names> leaves out repositories, and --without-repos without names leaves out all configured repositories, so only the ones in --with-repos are used, e.g. --no-index --index=https://r-lib.r-universe.dev. URLs cannot contain commas.
For P3M and for Bioconductor’s software repository rig reads their full package history, from https://ppm.r-pkg.org and https://ppm-bioc.r-pkg.org, so older and archived versions are available, too. Any other repository, e.g. CRAN itself, an r-universe, or one added with rig repos add, is read from its PACKAGES files, so only its current packages are available. Bioconductor packages are included if the Bioconductor repositories are enabled for the R version.
Reading the tree
A package that several others need is expanded only once, under its first occurrence. Later occurrences are a single line marked (*), meaning “its dependencies are above”.
Key for markers:
[D]: aDepends, so the package is attached, not merely loaded.[L]: aLinkingTo, so this package is compiled against it.[DL]: both.
(Imports is the most common and it is not marked.)
By default rig follows the hard dependencies only. --dev adds Suggests and Enhances, in their own [Suggests] and [Enhances] sections.
rig follows the dependencies of the latest version of every package in the tree, so a version requirement that would force an older version, with different dependencies, is not taken into account.
Inverting the tree
--why <package> (alias --explain) inverts the tree: the named package is the root and the tree grows towards the packages that need it, down to the queried package, which becomes a leaf.
glue 1.8.1 — 4 direct dependents, 5 total
├── dplyr 1.2.1 (needs >= 1.3.2)
├── pillar 1.11.1
│ └── dplyr 1.2.1 (needs >= 1.9.0)
└── vctrs 0.7.3
├── dplyr 1.2.1 (needs >= 0.7.1)
└── pillar 1.11.1 (needs >= 0.5.0) (*)
Each line says how that package needs the one above it. The [D], [L], [S] and [E] marks describe the same edge.
--why searches the tree only, not the repositories, so --version, --dev and --no-base apply, and a package that is not in the tree is an error.
Usage
rig pkg tree [OPTIONS] <package>
Arguments
<package>- package to show the dependency tree of
Options
--admin- Run in admin mode (overrides RIG_MODE and config)
--dev- Include dev (development) dependencies
-h, --help- Print help (see a summary with ‘-h’)
--json- JSON output
--no-base- Leave out R and the base packages
--no-cache- Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>- R version whose repositories to use, instead of the default
--user- Run in user mode (overrides RIG_MODE and config)
-v, --version <version>- package version to use (default: latest)
--why <PACKAGE>- Invert the tree: show what pulls this package in [aliases: explain]
--with-repos <REPOS>- Also use these repositories, a comma-separated list of repository names, URLs or name=URL pairs. Can be repeated. [aliases: index]
--without-repos[=<REPOS>]-
Do not use these repositories, a comma-separated list. Without a value, do not use any of the configured repositories, only the ones in
--with-repos. Can be repeated. [aliases: no-index]