+ "text": "rig pkg install\nInstall one or more R packages, and everything they need, into an R package library.\nrig pkg install cli glue\n✓ Solved dependencies\n2 of 2 packages to install (R 4.4.1, main: /Users/gaborcsardi/Library/R/arm64/4.4/library)\nPackage Version Type Action Reason\ncli 3.6.3 binary install not installed\nglue 1.8.0 binary install not installed\n✓ Installed 2 packages (R 4.4.1, main: /Users/gaborcsardi/Library/R/arm64/4.4/library)\nrig resolves the whole dependency tree first, the same way rig proj solve 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.\nPackage names are case sensitive, as they are in R. Naming the same package twice is not an error, it is installed once.\n\nDev dependencies\nBy 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.\n--dev applies to the packages named on the command line only. A dev dependency is installed with everything it needs to be installed, but not with its own dev dependencies, so --dev does not grow without bounds.\nA package often suggests packages that are not in the repositories rig installs from, e.g. Bioconductor packages. Those cannot be installed, and by default rig reports them and installs nothing. --ignore-unavailable installs the rest of the dev dependencies instead, and names the ones it skipped. It only applies to dev dependencies: a hard dependency that is not available is always an error, and so is a dev dependency that exists but has no version that fits.\n\n\nBinary and source packages\nA 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.\nA 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.\n--platform installs for a platform other than this machine’s, 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.\n\n\nWhat gets skipped\nrig does not install a package that is already installed and up to date, so running the same command twice does nothing the second time.\nBeing up to date is more than having the right version number. A repository can publish several builds of one version, and a package with compiled code only works with the versions of the packages it was compiled against — an R that loads a package built against a different one can crash rather than complain. So rig keeps track of which build each package it installs came from, and what that build was compiled against, and reinstalls a package whose build is no longer the one the resolution picked.\nThat check cascades: replacing a package also replaces the packages that were compiled against it, and the packages compiled against those.\nrig only knows this about packages it installed itself, so a package that R, pak or renv installed is always reinstalled rather than assumed to match. --reinstall installs everything in the resolution regardless.\n\n\nWhich library\nBy 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.\n--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:\nrig pkg install --library myproject cli\nrig pkg install --library /usr/lib/R/site-library cli\nA path is used as it is, and is created if it does not exist yet, so it does not need to belong to an R version rig manages.\n--r-version (-r) selects the library of another R version, instead of the default one, as it does for the rig library commands. It has no effect on which library --library names when that is a path, but it still decides which binary packages fit, and which R installs a source package.\nIn 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.\n\n\nUsage\nrig pkg install [OPTIONS] <package>...\n\n\nArguments\n\n<package>...\n\npackages to install\n\n\n\n\nOptions\n\n--admin\n\nRun in admin mode (overrides RIG_MODE and config)\n\n--dev\n\nInclude dev (development) dependencies\n\n--dry-run\n\nShow what would be installed, install nothing\n\n-h, --help\n\nPrint help (see a summary with ‘-h’)\n\n--ignore-unavailable\n\nSkip dev dependencies that are not available in the repositories, instead of failing\n\n--json\n\nJSON output\n\n-l, --library <library>\n\nLibrary name or path, instead of the default library\n\n--platform <platform>\n\nPlatform 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 --platform source to install source packages only.\n\n--prefer-binary[=<prefer-binary>]\n\nPrefer 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).\n\n-r, --r-version <r-version>\n\nR version to operate on, instead of the default\n\n--reinstall\n\nInstall the packages even if they are already up to date\n\n--user\n\nRun in user mode (overrides RIG_MODE and config)",
0 commit comments