rig proj

Manage R projects. rig proj is currently experimental, and might change in future versions. Feedback is appreciated.

A project is a directory with an rproj.toml manifest file, that declares the R packages the project depends on.

Workflow

  • rig proj init creates a new project. rig proj import creates a new project from an existing DESCRIPTION file. Alternatively, rig proj renv import creates a new project from an existing renv.lock file.

  • rig proj lock resolves the dependencies of the project.

  • rig proj sync installs the dependencies of the project.

  • rig run starts R, configured for the project. It calls rig proj lock and rig proj sync as needed.

  • rig proj add and rig proj remove adds and removes dependencies to/from the project.

The ‘tools’ package library

Projects treat the package library named tools specially. This library is automatically added to the library path for every project.

Use this for devtools, usethis, roxygen2, and other R packages that you use for R development. You can use rig pkg install -l tool <pkgs> to install packages into this library.

Subcommands

add
Add dependencies to rproj.toml
deps
Show project dependencies
export
Create a DESCRIPTION file from rproj.toml
import
Create rproj.toml from a DESCRIPTION file
init
Create a new R project
lock
Resolve project dependencies and write rproj.lock
remove
Remove dependencies from rproj.toml (alias: rm)
renv
Interoperate with renv, R’s package management tool
status
Show the project’s status
sync
Install the dependencies rproj.lock resolved
tree
Dependency tree of a project

rig proj add

Add one or more R packages to rproj.toml, rig’s project and package manifest, then update rproj.lock and install the new packages into the project library. Adding a package that the manifest already lists updates its version requirement.

A package is given as <package> or <package>@<version>:

rig proj add dplyr
rig proj add dplyr@1.1.0
rig proj add 'cli@>= 3.6' 'rlang@>= 1.0, < 2.0'

Without a version, the package is added as "*", i.e. any version. The concrete version rig picks is recorded in rproj.lock, so a project does not need a version requirement for every dependency; use one when the project really needs a particular version.

Because @ and the comparison operators are meaningful to most shells, quote a specification that contains a space or a > character, as in the examples above.

Bioconductor packages

Bioconductor packages are added the same way as CRAN packages, e.g. rig proj add limma, see “Bioconductor packages” in rig proj lock.

Packages from other repositories

--with-repos (--index) adds the packages from a repository other than CRAN and Bioconductor:

rig proj add --with-repos rlib=https://r-lib.r-universe.dev cli

A URL, or name=URL, that rproj.toml does not have yet is added to its [[repository]] entries. A URL without a name is named after its host. The name of a repository that rproj.toml already has, or cran or bioc, works too. The added packages are pinned to the repository, the first one if --with-repos names more than one:

[dependencies]
cli = { version = "*", repository = "rlib" }
[[repository]]
name = "rlib"
url = "https://r-lib.r-universe.dev"

See “Repositories” in rig proj lock. A git, GitHub, URL or local package cannot be added with --with-repos.

Git, GitHub, GitLab and URL sources

A package can also be added straight from a git repository, pak’s package reference syntax:

rig proj add r-lib/crayon
rig proj add r-lib/crayon@84be6207
rig proj add r-lib/crayon@some-branch
rig proj add r-lib/crayon#41
rig proj add r-lib/crayon@*release
rig proj add gitlab::group/project@main
rig proj add 'git::https://gitlab.com/example/pkg.git@main'
rig proj add 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), and the dependency is pinned by commit, or by the archive’s sha256 for a url:: source, not by version range: rig proj add resolves the reference right away, and rproj.lock records it.

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 sources

A package that is already on this machine, in a source directory or a package file, can be added straight from there:

rig proj add ../mypkg
rig proj add ~/works/mypkg
rig proj add mypkg_1.0.0.tar.gz
rig proj add local::mypkg

The path is recorded in rproj.toml relative to the project’s own directory (not the directory rig proj add was run from), so the manifest stays correct after the project is moved or checked out elsewhere, as long as the local package stays in the same place relative to it.

Version requirements

  • ^1.2.3 is compatible with 1.2.3, i.e. >= 1.2.3, < 2.0.0.
  • 1.2.3, a bare version, means the same as ^1.2.3.
  • ~1.2.3 is >= 1.2.3, < 1.3.0.
  • >= 1.2, > 1.2, <= 2.0, < 2.0 and = 1.2.3 are a single bound.
  • >= 1.0, < 2.0: a comma means and, so both bounds hold.
  • * is any version.

A bare version is written into the manifest in its explicit ^ spelling, so the file reads the same way whether or not you know that a bare version means compatible with.

The caret and tilde forms bump one component of the version and zero the ones after it: the leftmost non-zero component for ^ (^0.2.3 is >= 0.2.3, < 0.3.0), the second component for ~. R versions can have any number of components, so ^1.1.0.9000 is >= 1.1.0.9000, < 2.0.0.0.

Scripts

--script script.R adds the packages to the # /// script block of an R script, instead of rproj.toml, see scripts with inline dependencies. It creates the block if the script has none. The packages are given the same way as for a project, and a local path is recorded relative to the script’s directory. A script has no dependency groups, so --script does not work with --dev.

Then rig sets up the script’s environment in its cache directory, the same way rig run script.R would, so the next rig run can start right away. --no-sync and --no-lock work the same way as for a project. If resolving the dependencies fails, the script is restored to what it was.

Options

--dev adds the packages as development dependencies, into the [dependency-groups.dev] table instead of [dependencies]. These are installed by default, and left out by rig proj sync --no-dev.

--no-sync updates rproj.toml and rproj.lock, but does not install anything.

--no-lock only updates rproj.toml. Nothing is resolved or installed, so this also works offline.

Files

Only rproj.toml is edited. Changes are merged into the existing file, so comments and custom formatting are preserved where possible.

If resolving the dependencies fails (most often because a package name is misspelled, and no repository has such a package) rproj.toml is restored to what it was, so a failed rig proj add does not leave the project with a dependency that cannot be installed.

Usage

rig proj add [OPTIONS] <PACKAGE>...

Arguments

<PACKAGE>...
Packages to add, as <package> or <package>@<version>, e.g. dplyr or ‘dplyr@>= 1.1.0’

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--dev
Add as a dev (development) dependency
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--no-lock
Only update rproj.toml, do not update rproj.lock
--no-sync
Do not install the added packages
--script <SCRIPT>
Add the packages to the inline metadata of this R script, instead of rproj.toml
--user
Run in user mode (overrides RIG_MODE and config)
--with-repos <REPOS>
Add the packages from this repository: a repository name, URL or name=URL pair. A new repository is added to rproj.toml, and the packages are pinned to the first one. Comma-separated, and can be repeated. [aliases: index]

rig proj deps

Show the dependencies of an R project, in a table.

rig reads the project manifest, rproj.toml, in the current directory.

Add --dev to include every dependency group and optional-dependency extra together – unlike rig proj sync, which selects each one separately with --group/--extra, this is an all-or-nothing view of the manifest.

Use --json for machine readable output.

The plain listing only reads the manifest, so it needs neither R nor the package repositories.

Recursive dependencies

--recursive (-r) shows the whole dependency closure: not only the packages the project needs directly, but also the packages those need, and so on. Each package appears once, with the version currently on CRAN, the Depth column giving its distance from the project, and the Needed by column naming the packages that pull it in. This needs the package metadata of the project’s repositories, which rig downloads if it does not have it yet. --with-repos (--index) and --without-repos (--no-index) change the repositories for this command, see “Repositories” in rig proj lock.

See rig proj tree to show the dependency tree of the project.

rig follows the dependencies of the latest version of every package in the closure, so a version requirement that would force an older version, with different dependencies, is not taken into account.

Usage

rig proj deps [OPTIONS]

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, --recursive
Show recursive (transitive) dependencies
--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, e.g. cran,bioc. Without a value, do not use any of the project’s repositories, only the ones in --with-repos. Can be repeated. [aliases: no-index]

rig proj export

Read rproj.toml, rig’s project and package manifest, and write a DESCRIPTION file from it, the reverse of rig proj import.

rproj.toml field DESCRIPTION field
[project].name Package:
[project].version Version:
[project].title Title:
[project].description Description:
[project].license License:
[project].type Type:
[project].authors Authors@R
[project.urls].homepage URL:
[project.urls].source URL:
[project.urls].bugreports BugReports:
[dependencies] Depends / Imports
[linking-dependencies] LinkingTo
[dependency-groups.dev] Suggests
[dependency-groups.enhances] Enhances
[dependency-groups.<name>] Config/Needs/<name>
[optional-dependencies.<name>] Config/Needs/Optional/<name> + Suggests

DESCRIPTION’s dependency syntax only supports a single version comparison per package (pkg (>= 1.2.3)), unlike rproj.toml, which can express a two-sided range (e.g. ^1.2.3 means >= 1.2.3, < 2.0.0). When a dependency has both a lower and an upper bound, only the lower bound is written; rig prints a warning listing which packages were affected.

By default rig writes DESCRIPTION in the current directory; use --output to write to a different file.

rig refuses to overwrite an existing DESCRIPTION file that was not created by rig. Pass --force is given to overwrite an existing DESCRIPTION file.

Usage

rig proj export [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-f, --force
Overwrite the output file if it already exists
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-o, --output <output>
Output file to write (e.g. DESCRIPTION)
--user
Run in user mode (overrides RIG_MODE and config)

rig proj import

Read a DESCRIPTION file and create rproj.toml, rig’s project and package manifest, from it. Fails if rproj.toml already exists, use --dependencies to merge dependencies into an existing file instead.

DESCRIPTION field. rproj.toml field.
Package: [project].name
Version: [project].version
Title: [project].title
Description: [project].description
License: [project].license
Type: [project].type
URL: [project.urls].homepage
URL: [project.urls].source
BugReports: [project.urls].bugreports
Authors@R [project].authors
Maintainer: [project].authors
Depends [dependencies]
Imports [dependencies]
LinkingTo [linking-dependencies]
Suggests [dependency-groups.dev]
Enhances [dependency-groups.enhances]
Config/Needs/<name> [dependency-groups.<name>]
Config/Needs/Optional/<name> [optional-dependencies.<name>]

Authors@R is parsed into [project].authors, one entry per person() call, in order; this is a best-effort parser for common person() usage (name, email, role, and an ORCID/ROR comment), not a full R parser, so unusual calls are skipped with a warning. If Authors@R is absent, the simpler Maintainer: Name <email> field is used instead, as a single author with role cre.

Config/Needs/<name> depepdencies are parsed specially, an entry that is not a plain package name (with an optional version requirement) is kept verbatim as ref = "...". E.g. tidyverse/tidytemplate becomes tidytemplate = { ref = "tidyverse/tidytemplate" }. rig proj export writes these back unchanged. Note that only the dev and enhances groups are installed by rig, so a Config/Needs/* group is carried in the manifest, but not solved or installed by rig proj lock and rig proj sync. This behavior will be improved in the future.

Config/Needs/Optional/<name> fields are parsed the same way, into [optional-dependencies.<name>] instead of [dependency-groups.<name>]. A package listed there is also Suggests-listed in the same DESCRIPTION file (rig proj export writes it to both places, since R CMD check only allows using a package conditionally if it’s Suggests-listed), so it also ends up in [dependency-groups.dev], same as any other Suggests entry.

Files

A full import sets up a whole project, not just its manifest, so it creates the same files as rig proj init .

--r-version sets the R version the project is set up for. It does not have to be installed, and it does not change what is written: the manifest’s R requirement always comes from the DESCRIPTION file, and the .rvenvlib/rvenv shim package works with every R. The default is the current default R version, or the current R release if there is no default.

--prefer-binary writes prefer-binary = true (--prefer-binary=5: prefer-binary = 5) into the manifest’s [tool.rig] table, like for rig proj init. With --dependencies it is set in the existing manifest, too, and --prefer-binary=0 writes prefer-binary = false, to turn it off.

Usage

rig proj import [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--dependencies
Only merge dependencies, not metadata (the old behavior)
-f, --force
Overwrite existing project files
-h, --help
Print help (see a summary with ‘-h’)
-i, --input <input>
DESCRIPTION file to import (e.g. DESCRIPTION)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--prefer-binary[=<prefer-binary>]
Write prefer-binary into the [tool.rig] table of the manifest, see rig proj lock–prefer-binary`. Optionally give how many of the newest versions to consider, e.g.–prefer-binary=5(default: 3).–prefer-binary=0writesprefer-binary = false`.
-r, --r-version <r-version>
R version of the project (default: the version the DESCRIPTION file requires, the default R version, or the current R release)
--user
Run in user mode (overrides RIG_MODE and config)

rig proj init

Set up an R project in the current directory: the rproj.toml manifest, plus the part of the project’s virtual environment that belongs in version control.

rproj.toml is rig’s project manifest. It describes the project’s metadata and its R and package dependencies.

rig proj init writes a minimal skeleton: a [project] table with the name (taken from the current directory) and version, and a [dependencies] table with a single R requirement, that you then fill in.

Use rig proj import instead to set up the same project from an existing DESCRIPTION file.

Files

rig proj init creates these, and nothing else. All of them are meant to be committed, so that a fresh clone of the project works right away:

  • rproj.toml - the manifest.
  • .Renviron, .rvenvlib/rvenv - boilerplate to set up R’s libraries for the project when started from the project directory, in a terminal, of from an editor (RStudio, Positron, VS Code).
  • .gitignore - to ignore .rvenv which contains the project library and configuration files, created by rig proj sync.

The R virtual environment in .rvenv, including the project library .rvenv/lib, is machine-specific and is created by rig proj sync . It can be deleted and rebuilt at any time.

Note that R --vanilla ignores .Renviron, and so does not use the project library.

Scripts

rig proj init --script script.R sets up a single script instead of a project: it adds a # /// script block with an R requirement to the top of the script, or creates the script, if it does not exist yet:

# /// script
# [dependencies]
# R = ">= 4.6"
# ///

The block goes after a #! line, if the script has one. It does not create any other file. Add packages to the block with rig proj add --script, and run the script with rig run, which sets up an environment for it, see scripts with inline dependencies. rig refuses to replace a block that is already there, pass --force to replace it.

Options

--r-version sets the R version the project is for. It does not have to be installed. Defaults to the current default R version, or the current R release if there is no default.

--prefer-binary writes prefer-binary = true into the manifest’s [tool.rig] table (or the script’s block), so rig proj lock prefers an older version with a binary package over a newer one without, see rig proj lock. --prefer-binary=5 writes prefer-binary = 5, to consider the five newest versions instead of three.

rig refuses to overwrite any of the files above; pass --force to replace them. .Renviron and .gitignore are the exceptions: rig never refuses on an existing .Renviron or .gitignore, it just merges its block into them (or adds one), leaving the rest of the file alone, and --force does not change that.

Usage

rig proj init [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-f, --force
Overwrite existing project files
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--prefer-binary[=<prefer-binary>]
Write prefer-binary into the [tool.rig] table of the manifest, see rig proj lock–prefer-binary`. Optionally give how many of the newest versions to consider, e.g.–prefer-binary=5(default: 3).–prefer-binary=0writesprefer-binary = false`.
-r, --r-version <r-version>
R version of the project (default: the default R version, or the current R release)
--script <SCRIPT>
Create the inline metadata block of this R script, instead of a project
--user
Run in user mode (overrides RIG_MODE and config)

rig proj lock

Resolve the dependencies of an R project to a concrete set of package versions, and write the result to rproj.lock.

rig reads the project manifest, rproj.toml, in the current directory, and uses its built-in solver to find a compatible set of package versions from the project’s repositories: CRAN and Bioconductor by default, see “Repositories” below.

rig proj solve does not run R.

Use --r-version to solve for a specific R version.

Optional dependencies and dependency groups

Every [dependency-groups.*] table (dev, enhances, or any other name) and every [optional-dependencies.*] extra are optional dependencies: packages the project suggests or can take advantage of, but does not need to run. rig proj lock always solves all of them together with the project’s hard dependencies, in one solve, so rproj.lock is complete – a version picked for a shared package is the same whether it got pulled in as a hard or an optional dependency, and every group and extra is available to install without a new solve. A [dependency-groups.*] table can also include-groups = [...] other groups, pulling in their packages too; rig proj lock follows this when solving, and rejects a cycle (a group that includes itself, directly or through others).

rig proj sync is where a subset of this is picked for installation – by default main plus the dev group, more with --group/--all-groups/--extra/--all-extras.

The R version

Without --r-version rig solves for the default R version, provided the manifest’s own R requirement allows it. If it does not, rig takes the newest installed R version that does, and failing that the current R release. The version it picks does not have to be installed: rig proj lock never runs R, and rig proj sync installs the R version the lock file names.

To always solve for the same R versions, list them in rproj.toml. rig solves for each of them, for every platform, and --r-version replaces the list:

[tool.rig]
r-versions = ["4.5", "4.6"]

Each entry takes the same values as --r-version. A minor version, e.g. 4.5, matches any patch release of it.

Repositories

By default a project solves from two built-in repositories: CRAN, with the metadata of Posit Package Manager, which has every version ever published, and Bioconductor, see below. rig does not use the repositories of your R installations, or the ones you set up with rig repos: a project only uses the repositories in its rproj.toml, so it locks the same way on every machine.

Add a CRAN-like repository with a [[repository]] entry:

[[repository]]
name = "rlib"
url = "https://r-lib.r-universe.dev"

rig only sees the package versions in the PACKAGES files of a CRAN-like repository, usually the current version of each package.

The order of the entries is the order of precedence: if two repositories have the same version of a package, the first one wins. The built-in repositories come after the entries of rproj.toml, Bioconductor first, unless they have an entry of their own. A cran or bioc entry has no url. It puts the repository at its place in the order, and enabled = false turns it off:

[[repository]]
name = "cran"
enabled = false

Pin a dependency to a repository with repository, and rig only takes the package from there:

[dependencies]
cli = { version = ">= 3.6", repository = "rlib" }

A pin can name any repository of the project, cran and bioc included. It applies to the package itself, not to its dependencies. rig proj add --with-repos adds the repository and the pin in one step.

explicit = true makes a repository serve only the packages pinned to it, e.g. a private repository that must not replace CRAN packages of the same name:

[[repository]]
name = "internal"
url = "https://cran.example.com"
explicit = true

--with-repos (--index) and --without-repos (--no-index) change the repositories for one rig proj lock run, without editing rproj.toml. Both take a comma-separated list, and can be repeated. An item of --with-repos is the name of a repository, which turns it on if rproj.toml turns it off, or a URL or name=URL: an extra repository that comes before all the others. --without-repos=cran,bioc turns those two off, and a bare --without-repos turns off all repositories of the project, so only the ones in --with-repos are used. E.g. to solve from one repository instead of CRAN and Bioconductor, and keep the project’s own repositories:

rig proj lock --without-repos=cran,bioc --with-repos https://cran.example.com

rproj.lock records the repositories that are on in its [tool.rig] table, in order of precedence, with the URL of the extended metadata for CRAN and Bioconductor, and repository = "<name>" for each package of a CRAN-like repository. A lock solved with other repositories is solved again, and so is a lock with a package from another repository than its pin says. Both keep the pinned versions where they fit, see “Sticky lock files” below.

Bioconductor packages

rig solves from CRAN and from the Bioconductor release that belongs to the target’s R version, e.g. Bioconductor 3.23 for R 4.6. You do not need to set up anything: rig proj add limma works like rig proj add dplyr. Some R versions have two Bioconductor releases, e.g. 3.21 and 3.22 for R 4.5, and rig uses the newer one. With --exclude-newer it uses the release that was current on the cutoff day, see below.

A bioc entry in [[repository]] pins the Bioconductor release, e.g. to use the development version, or turns Bioconductor off:

[[repository]]
name = "bioc"
version = "3.24"
[[repository]]
name = "bioc"
enabled = false

The R_BIOC_VERSION environment variable also pins the release, and RIG_BIOCONDUCTOR=false turns Bioconductor off for every project.

rproj.lock records the Bioconductor release of each target as bioc-version, and repository = "bioc/<version>" for each Bioconductor package. A target solved with another release is solved again. rig proj sync also adds the Bioconductor repositories of that release to the project environment, so install.packages() finds Bioconductor packages, too.

Source and binary packages

The solver considers binary packages as well as source packages, and prefers a binary build when one is available for the same version. By default a binary build never changes which version rig picks: the newest suitable version wins, and a binary of it is used if there is one. Use --prefer-binary to let an older version win instead, when the newest one has no binary but an older one does, typically because a version was released so recently that it has not been built yet. Only the three newest versions of a package are considered; --prefer-binary=5 considers five. Versions held back this way are marked in the output.

To make it part of the project, set it in rproj.toml. true means the default of three versions, a number gives the number of versions:

[tool.rig]
prefer-binary = true

--prefer-binary overrides it, and --prefer-binary=0 turns it off. rproj.lock records the setting in its [tool.rig] table, and a lock solved with a different one is solved again, keeping the pinned versions where they fit, see “Sticky lock files” below.

By default rig solves for this machine plus the three other common platforms (aarch64-apple-darwin, x86_64-w64-mingw32 and x86_64-unknown-linux-gnu, which is any glibc Linux), and for source packages only (source), so the lock file also works on platforms without binary packages. rig proj sync only uses the source target if no other target matches the machine.

To use a different set of platforms for a project, list them in rproj.toml. This replaces the default set, so include this machine’s platform if you want it:

[tool.rig]
platforms = [
  "aarch64-apple-darwin",
  "x86_64-w64-mingw32",
  "x86_64-unknown-linux-gnu-ubuntu-24.04",
  "source",
]

Use --platform to solve for a different set instead of the manifest’s list or the default set, e.g. a single specific distro:

rig proj lock --platform ubuntu-24.04

Use --add-platform to add a platform to the manifest’s list or the default set rather than replacing it. --add-platform can be repeated:

rig proj lock --add-platform ubuntu-24.04 --add-platform linux-fedora-42

rproj.lock writes each platform as a target triple, e.g. aarch64-apple-darwin, x86_64-w64-mingw32, x86_64-unknown-linux-gnu or x86_64-unknown-linux-gnu-ubuntu-24.04, or source. platforms, --platform and --add-platform take the same strings, and shorter forms too:

  • macos, windows, linux, or with an arch: macos-arm64, windows-x86_64, linux-aarch64.
  • ubuntu-24.04, fedora-42, opensuse-15.6 – a Linux distro and version, matched against P3M’s build list.
  • manylinux_2_28-arm64, jammy-x86_64 – a P3M platform name and arch.
  • source – source packages only, for any platform.

Without an arch, the platform has this machine’s arch if it runs the same OS, otherwise aarch64 for macOS and x86_64 for Windows and Linux. See rig system detect-platform for more about platform strings.

A Linux distro/version or platform name P3M has no specific build for falls back to its generic manylinux build for the given arch, rather than failing.

rig also falls back to source packages when there are no binaries for a platform at all.

rig keeps the repository metadata and the binary package indices it solves from in its cache, and refreshes them once a day. Use --no-cache to ignore the cache, or clean the cache with rig cached clean.

Sticky lock files

A rig proj lock run that finds an existing rproj.lock already satisfying rproj.toml reuses it as-is, for every package, instead of re-resolving anything. This applies to ordinary dependencies, an existing pin that still satisfies the manifest’s version requirement is kept, even if a newer version has since been published, as well as to git/GitHub dependencies (see below).

If rproj.toml changed, e.g. after rig proj add, rig solves the dependencies again, but it still keeps the versions rproj.lock pins, as long as they fit. So adding a package only changes the versions it needs changed, and does not upgrade the rest of the project. A platform or R version that is new to the lock file gets the same versions as the other platforms of the same R version, where possible.

Use rig proj lock --upgrade to ignore the existing lock file and re-resolve every dependency instead, picking the latest version that still satisfies rproj.toml.

Use --upgrade-package to upgrade only some packages, and keep the rest:

rig proj lock --upgrade-package cli
rig proj lock -P cli,glue

The packages they depend on are only upgraded if they need to be. You can also give a version requirement, with the same <package>@<version> syntax as rig proj add, e.g. to upgrade or downgrade to a specific version:

rig proj lock -P 'cli@>= 3.6.4'
rig proj lock -P 'cli@=3.6.2'

The requirement only applies to this run, it is not written to rproj.toml. Later rig proj lock runs keep the version it picked, as long as it fits rproj.toml. A git/GitHub dependency named in --upgrade-package is checked against its remote again, like with --upgrade.

Excluding newer package versions

--exclude-newer makes the solver ignore CRAN and Bioconductor package versions published after a date, so you can lock the project as the repositories were on that day, or skip versions released in the last few days:

rig proj lock --exclude-newer 2025-06-01
rig proj lock --exclude-newer "7 days"

It takes a date (2025-06-01), an RFC 3339 timestamp (only its UTC date is used), or a span back from today, e.g. 7 days, 2 weeks or P1M. A version’s publication date is the day it first appeared in a Posit Package Manager snapshot, so the cutoff is a day, and it cannot be earlier than 2017-10-10, the first snapshot. It only applies to CRAN and Bioconductor packages, not to git, GitHub, URL or local dependencies, and binary builds of a version are used no matter when they were built. If the target’s R version has two Bioconductor releases, the cutoff also chooses between them: the newer one if it was released by the cutoff day, otherwise the older one.

To make it part of the project, set it in rproj.toml; --exclude-newer overrides it:

[tool.rig]
exclude-newer = "2025-06-01"

rproj.lock records the cutoff in its own [tool.rig] table, and a lock solved with a different one is solved again. This keeps the pinned versions that are not newer than the new cutoff, see “Sticky lock files” above. For a span, the lock records the span as well, and the lock is reused as long as the span stays the same, so the cutoff does not move every day. Use --upgrade to solve again with a fresh cutoff.

Git, GitHub and URL dependencies

A git::/github:: dependency pinned to a branch, a pull request, or no ref at all (the default branch’s tip) is only resolved against its remote the first time it’s locked. Once rproj.lock records a commit for it, later rig proj lock runs reuse that commit as-is rather than re-checking whether the branch moved on every lock. rig proj lock --upgrade re-checks every git/GitHub dependency’s ref and moves the pin forward if it changed. A rev/tag pins an exact commit already, so there’s nothing for --upgrade to move. release = true is sticky the same way: once locked, later runs keep the release it pinned instead of asking GitHub which release is latest every time. rig proj lock --upgrade re-checks and moves the pin forward if a newer release exists.

A url:: dependency names one exact archive rather than a movable ref, so there’s nothing for --upgrade to move either: every rig proj lock run downloads it (the download itself is cached) and records its sha256 in rproj.lock, which then changes only if the archive’s contents change. Set hash on a url dependency to pin the expected sha256 and catch that.

The rproj.lock file records, for every package, whether it is a source or a binary package and the URL it is downloaded from. It also records where the file is cached, which is per build rather than per version: a repository can offer several binaries of one version for one platform and R version, and they are cached side by side.

Scripts

rig proj lock --script script.R locks the dependencies in the # /// script block of an R script, instead of a project, and writes them to script.R.lock, next to the script. It takes the same options as for a project, and an existing script.R.lock is sticky in the same way. rig run script.R then installs the versions the lock file names, see rig run.

Workspaces

A manifest with a [workspace] table is the root of a workspace: a monorepo of several projects or packages, listed as path patterns in members, that share one rproj.lock and one package library. exclude drops directories a members pattern would otherwise match, and the root manifest is always a member of its own workspace.

rig proj lock in a workspace (from the root or from any member directory) reads every member and resolves them all in one solve, so that every member ends up with the same version of every shared dependency, and writes one rproj.lock at the workspace root. A member that depends on a sibling member is resolved against that sibling’s own dependencies. The members themselves are directories rather than packages to download, so they are not recorded in the lock file.

The R version rig solves for has to satisfy every member’s R requirement, not just the root’s.

[workspace.dependencies] declares shared version requirements. A member inherits one by name, instead of spelling out its own requirement:

# rproj.toml, the workspace root
[workspace]
members = ["packages/*"]
[workspace.dependencies]
cli = ">= 3.6.0"
# packages/mypkg/rproj.toml, a member
[dependencies]
cli = { workspace = true }

An entry no member inherits has no effect on the solve; it is a declaration, not a request. Whether a member attaches a package (attach) is still the member’s own business, and is kept when the rest of the entry is inherited.

Usage

rig proj lock [OPTIONS]

Options

--add-platform <add-platform>
Add platform(s) to the set rig would otherwise solve for (rproj.toml’s platforms or the default set), instead of replacing it. Comma-separated, and can be repeated.
--admin
Run in admin mode (overrides RIG_MODE and config)
--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’)
--json
JSON output
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--platform <platform>
Platform(s) to solve binary packages for, e.g. macos, windows, ubuntu-24.04, or a full platform string like aarch64-unknown-linux-gnu-ubuntu-24.04. Comma-separated to solve for several (e.g. --platform macos,windows). Combined with --r-version as a cross product, one target per combination. Use --platform source to solve for source packages only. Default: platforms in [tool.rig] of rproj.toml, or this machine, x86_64-w64-mingw32, x86_64-unknown-linux-gnu, aarch64-apple-darwin and source.
--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). Overrides prefer-binary in rproj.toml, --prefer-binary=0 turns it off.
-r, --r-version <r-version>
R version(s) to solve dependencies for, comma-separated to solve for several (e.g. --r-version 4.5,4.6). Combined with --platform as a cross product, one target per combination. Default: r-versions in [tool.rig] of rproj.toml, or one R version, see --help.
--script <SCRIPT>
Lock the inline metadata of this R script into <SCRIPT>.lock, instead of locking the project
-U, --upgrade
Re-resolve every dependency instead of reusing an existing rproj.lock: re-check git/GitHub refs against their remotes, and re-run the solver for CRAN/PPM dependencies instead of keeping a pin that already satisfies rproj.toml.
-P, --upgrade-package <PACKAGE>
Upgrade only these packages, and keep the versions rproj.lock pins for the rest, where they still fit. As <package> or <package>@<version>, e.g. cli or ‘cli@>= 3.6.4’. The version is not written to rproj.toml. Comma-separated, and can be repeated.
--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, e.g. cran,bioc. Without a value, do not use any of the project’s repositories, only the ones in --with-repos. Can be repeated. [aliases: no-index]

rig proj remove

Alias: rig proj rm

Remove one or more R packages from rproj.toml, rig’s project and package manifest, then update rproj.lock and the project library to match. A package is removed wherever it is listed: [dependencies], [linking-dependencies], or any [dependency-groups.*] table.

Naming a package that is not a dependency in rproj.toml is an error, and none of the named packages are removed if any of them is not found, so a typo cannot silently remove the wrong set of packages.

Scripts

--script script.R removes the packages from the # /// script block of an R script, instead of rproj.toml, see scripts with inline dependencies. Then rig sets up the script’s new environment, the same way rig proj add --script does.

Options

--no-sync updates rproj.toml and rproj.lock, but does not touch the project library.

--no-lock only updates rproj.toml. Nothing is resolved or installed, so this also works offline.

Files

Only rproj.toml is edited. Changes are merged into the existing file, so comments and custom formatting are preserved where possible.

If resolving the remaining dependencies fails, rproj.toml is restored to what it was, so a failed rig proj remove does not leave the project with a manifest that cannot be locked.

Usage

rig proj remove [OPTIONS] <PACKAGE>...

Arguments

<PACKAGE>...
Packages to remove

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--no-lock
Only update rproj.toml, do not update rproj.lock
--no-sync
Do not re-sync the project library
--script <SCRIPT>
Remove the packages from the inline metadata of this R script, instead of rproj.toml
--user
Run in user mode (overrides RIG_MODE and config)

rig proj renv

Convert between rig’s own project format ( rproj.toml ) and renv.lock, the lock file renv uses.

Subcommands

export
Write an renv.lock file from rproj.toml
import
Create rproj.toml from an renv.lock file

rig proj renv export

Resolve the dependencies of the project in the current directory (its rproj.toml manifest) with rig’s built-in solver, for one (R version, platform) target, and write the result as renv.lock.

Unlike rig proj lock , this only ever solves a single target, since renv.lock has no multi-target concept.

Without --r-version, rig solves for the default R version, provided the manifest’s own R requirement allows it; otherwise the newest installed R version that does, and failing that the current R release. Without --platform, rig solves for this machine.

Usage

rig proj renv export [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--platform <platform>
Platform to solve binary packages for, e.g. macos, windows, ubuntu-24.04 (default: this machine). Use --platform source to solve for source packages only.
-r, --r-version <r-version>
R version to solve dependencies for (default: same logic as rig proj lock)
--user
Run in user mode (overrides RIG_MODE and config)

Examples

rig proj renv export
rig proj renv export --r-version 4.5 --platform ubuntu-24.04

rig proj renv import

Read an renv.lock file and create rproj.toml, rig’s project manifest, from it: one dependency per locked package (with a ^-pinned version requirement), and an R requirement from the lock file’s R version. Fails if rproj.toml already exists; use --dependencies to merge into an existing file instead.

renv.lock has no project metadata (name, title, authors, …), so a new manifest is named after the current directory.

By default rig reads renv.lock in the current directory; use --input to point to a different file.

After importing, run rig proj lock to solve the dependencies and write rproj.lock.

Files

A full import sets up a whole project, not just its manifest, so it creates the same files as rig proj init .

rig refuses to overwrite any of the .rvenv files above; pass --force to replace them.

The --dependencies option

--dependencies does not require rproj.toml to be missing: if it exists, its dependencies are merged into it (importing a package already listed overwrites its entry with the version requirement from renv.lock), preserving comments and custom formatting where possible; if it does not exist, a minimal manifest is created first.

Usage

rig proj renv import [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--dependencies
Only merge dependencies, not metadata
-f, --force
Overwrite existing project files
-h, --help
Print help (see a summary with ‘-h’)
-i, --input <input>
renv.lock file to import (e.g. renv.lock)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>
R version of the project (default: the version in the renv.lock file)
--user
Run in user mode (overrides RIG_MODE and config)

rig proj status

Show what rig knows about the project in the current directory, or the workspace it belongs to: the manifest, the lock file, and whether the local project environment is in sync with it.

This is read-only. It never solves dependencies, downloads anything, or changes the project – see rig proj lock and rig proj sync for that.

The report has three parts, each shown only if it applies:

  • Manifest – the project’s name and version from rproj.toml, its workspace members if it is a workspace, and its dependency counts by group (main plus any [dependency-groups.*]).
  • Lock file – rproj.lock’s version, and one row per locked target: the R version, the platform, and how many packages it locks.
  • Environment – the R version and platform the local .rvenv was last synced against, and whether it is still up to date with the lock file, or why not.

Use --json for machine readable output.

Usage

rig proj status [OPTIONS]

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)
--user
Run in user mode (overrides RIG_MODE and config)

rig proj sync

Bring an R project’s environment in line with its rproj.lock: install the resolved dependencies, and write the rest of the .rvenv layout.

rig looks for the project in the current directory and its parents, reads its rproj.lock and installs the packages into the project library. If the project has no rproj.lock yet, rig runs rig proj lock with its default options first. Pass --frozen to fail instead, without touching rproj.toml at all: every package rproj.lock lists already carries its own download URL, so nothing but the lock file is needed to install from it. The one exception is .rvenv/etc/repositories (see below), which still comes from rproj.toml when one is present, and is skipped otherwise.

--with-repos (--index) and --without-repos (--no-index) lock again first, with the project’s repositories changed, see “Repositories” in rig proj lock. They do not work with --frozen.

By default sync installs [dependencies] (main) plus the dev dependency group, and nothing else: no other [dependency-groups.*] table, and no [optional-dependencies.*] extra. --no-dev leaves the dev group out too, installing only main. Pass --group <name> (repeatable, or comma-separated) to also install a specific named group, or --all-groups for every group the project declares.

--extra <name> / --all-extras do the same for optional-dependency extras, none of which are installed unless asked for.

Naming a group always wins over --no-dev, which only skips the dev group that would otherwise be added automatically: --no-dev --group dev still installs dev, and --group dev on its own is equivalent to the default. The lock file records every group and extra each package belongs to, so this selection works the same with or without --frozen.

--max-concurrent limits the number of simultaneous installations. It defaults to the concurrent-installs config entry (RIG_CONCURRENT_INSTALLS), which itself defaults to the number of CPU cores.

By default, sync also removes any package that is in the project library but not selected for install by the flags above, e.g. one dropped from rproj.toml, or a group/extra left out. This only ever removes packages that are still in rproj.lock but not currently wanted – nothing is removed just because a group/extra selection changed since the last sync. Pass --inexact to leave those packages alone instead.

Pass --dry-run to print what sync would install, remove or write, without touching the R installation, the project library or .rvenv.

--exclude-newer runs rig proj lock with the same option first, even if there is an rproj.lock already, to ignore CRAN package versions published after a date. The existing lock is kept if it was solved with the same cutoff. It cannot be combined with --frozen.

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.

The project’s own package

If the project’s type is "package", rig proj lock records the project itself in rproj.lock, and sync installs it into the project library from the project directory, the same way it installs a path dependency. Sync updates an automatically generated DESCRIPTION at the project root from rproj.toml first, same as rig proj export would.

Pass --no-install-project to leave it out. It still gets installed if another package in the wanted set actually depends on it by name.

Centralizing the project library

The project library defaults to .rvenv/lib, inside the project. Set the RIG_PROJ_LIBRARY_ROOT environment variable, or the proj-library-root configuration entry, to a directory to centralize every project’s library under it instead, one subdirectory per project. rig system dirs --library-root reports the effective root, or that none is set. --library still wins outright when passed, for either a one-off location or a shared library across several projects.

When the library is centralized, sync still leaves a symlink at .rvenv/lib pointing at the real location, so anything that expects a library there keeps working.

The R version

The lock file records the R version its solve is valid for, and that is the R rig installs the packages with. It has to be that very version: another patch release of the same minor version would run the packages, but it is not the R the project was solved for, so rig does not quietly use it.

If that R version is not installed, rig installs it first, the way rig add would. Pass --no-install-r to fail instead, e.g. in CI. rig never rewrites rproj.lock to an R version that is already installed. Run rig proj lock to change the R version a project is locked for.

Several targets in one lock file

If rproj.lock has multiple platforms, then rig proj sync picks the target whose platform matches the OS it runs on. A target for a different OS is simply inert, which is what makes locking for a Linux deployment target from a macOS laptop work: each machine’s rig proj sync picks its own entry from the same file.

On Linux the distro has to match, too: a target for a specific distro and release, e.g. x86_64-unknown-linux-gnu-ubuntu-22.04, is only used on that distro and release. The generic glibc target, x86_64-unknown-linux-gnu, fits any glibc Linux, but rig prefers the target for this distro if the lock file has both. glibc and musl (Alpine) targets do not mix.

If more than one target matches this machine’s OS (typically because the project locks for several R versions), rig picks the highest R version among them, with no need for extra flags. Pass --r-version and/or --platform to pick a different one of the matching targets instead. --platform takes any spelling of the platform, e.g. macos picks the aarch64-apple-darwin target on an arm64 Mac. rig proj sync fails if none of the lock file’s targets match this machine at all.

What sync writes

Everything below .rvenv is machine-specific and is not committed. The project library is filled in from the lock file (see above for where it lives, by default or centralized), and the rest is rewritten on every sync:

  • .rvenv/bin/R and .rvenv/bin/Rscript, wrapper scripts that set the project’s environment and then hand over to the real R. Run them directly, or put .rvenv/bin on your PATH.
  • .rvenv/bin/activate and its activate.csh / activate.fish / activate.bat / Activate.ps1 siblings, for the shells that prefer to be activated. Source the one for your shell, and call deactivate when you are done. Activation is a convenience, not a requirement: the wrappers work without it, and an R session started by an IDE picks the project up through the project’s .Renviron.
  • .rvenv/rvenv.cfg, which records the R version, the platform and the architecture the environment was built for. rig warns when it syncs an environment that was built for a different R.
  • .rvenv/etc/repositories, which the wrappers point R_REPOSITORIES at. The repositories of the project: Posit Package Manager’s CRAN for the lock file’s target, unless rproj.toml turns cran off, then the [[repository]] entries, and the Bioconductor release of the target.

After a successful sync rig records the lock file it installed from in .synced, inside the project library (.rvenv/lib by default, or the centralized location). The rvenv package in .rvenvlib compares the two, and warns in every R session while the project library does not match rproj.lock.

Workspaces

In a workspace (see rig proj lock ) every member shares one rproj.lock and one package library, both at the workspace root. rig proj sync from a member directory therefore syncs the whole workspace, and installs the union of every member’s dependencies into the root’s .rvenv/lib.

Usage

rig proj sync [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--all-extras
Install every optional-dependency extra.
--all-groups
Install every dependency group.
--dry-run
Show what sync would do, without installing, removing or writing anything
--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.
--extra <NAME>
Install this optional-dependency extra. Not installed by default. Repeat or comma-separate for several.
--frozen
Install only from rproj.lock, without touching rproj.toml. Fails if rproj.lock does not exist, instead of creating it.
--group <NAME>
Also install this dependency group, in addition to the default set (main, plus dev unless --no-dev). Repeat or comma-separate for several.
-h, --help
Print help (see a summary with ‘-h’)
--inexact
Do not remove packages from the library that are not in rproj.lock (default: remove them)
--max-concurrent <max-concurrent>
Maximum number of concurrent installations (default: number of CPU cores, see ‘concurrent-installs’ in ‘rig config’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--no-dev
Do not install the dev dependency group (default: installed alongside main). An explicit --group dev or --all-groups installs it anyway.
--no-install-project
Do not install the project’s own package (default: installed when ‘type = “package”’). Still installed if another package actually depends on it.
--no-install-r
Fail if the R version the lockfile needs is not installed, instead of installing it
--no-sysreqs Linux only
Do not install the system packages the R packages need
--platform <platform>
Which of rproj.lock’s targets to sync, when more than one matches this machine. Selects among the targets already in rproj.lock, does not trigger a new solve. Any spelling of the platform works, e.g. macos for aarch64-apple-darwin.
-r, --r-version <r-version>
Which of rproj.lock’s targets to sync, when more than one matches this machine (default: the highest R version). Selects among the targets already in rproj.lock, does not trigger a new solve.
--sysreqs Linux 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, e.g. cran,bioc. Without a value, do not use any of the project’s repositories, only the ones in --with-repos. Can be repeated. [aliases: no-index]

rig proj tree

Show the dependency tree of a project. Example:

myproject 0.1.0 — 3 direct, 24 total
├── R (>= 4.1) [D]
├── cli 3.6.4
│   ├── R (>= 3.4) [D]
│   └── utils
└── dplyr 1.1.4 (>= 1.1.0)
    ├── cli 3.6.4 (>= 3.4.0) (*)
    └── vctrs 0.6.5 (>= 0.6.4)
        └── cpp11 0.5.2 [L]
[Suggests]
└── testthat 3.2.3 (>= 3.1.5)

rig reads the project manifest, rproj.toml, in the current directory, and the package metadata of the project’s repositories. --with-repos (--index) and --without-repos (--no-index) change the repositories for this command, see “Repositories” in rig proj lock.

Reading the tree

A package that several others need is expanded only once, under its first occurrence; later occurrences are marked (*), meaning “its dependencies are above”. --dev adds every dependency group and optional-dependency extra together, in their own [Suggests] and [Enhances] sections – unlike rig proj sync, which selects each group and extra separately with --group/--extra, this is an all-or-nothing view of the manifest. --no-base leaves out R and the base packages. Among the hard dependencies, Imports is not marked, [D] is a Depends, [L] a LinkingTo, [DL] both.

--why <package> (alias --explain) inverts the tree, so that the named package is the root and the tree grows towards the packages that need it, down to the project itself. Each line then says how that package needs the one above it, hence needs.

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.

Usage

rig proj tree [OPTIONS]

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)
--user
Run in user mode (overrides RIG_MODE and config)
--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, e.g. cran,bioc. Without a value, do not use any of the project’s repositories, only the ones in --with-repos. Can be repeated. [aliases: no-index]