FAQ
Why does rig create a user package library?
Installing non-base packages into a user package library has several benefits:
- The system library is not writeable for regular users on some systems (Windows and Linux, typically), so we might as well create a properly versioned user library at the default place.
- Some tools need a clean R environment, with base packages only, and do not work well if user packages are installed into the system library. E.g.
R CMD checkis such a tool, and https://github.com/r-lib/revdepcheck is another.- You can delete an R installation (e.g. with
rig rm) and then install it again, without losing your R packages.
Why does rig install pak?
To be able to install R packages efficiently, from CRAN, Bioconductor or GitHub, right from the start. pak also supports installing system libraries automatically on some Linux systems.
If you don’t want
rig addto install pak, use the--without-pakoption.
Why does rig change the permissions of the system library (on macOS)?
To make sure that you don’t install packages accidentally into the system library. See “Why does rig create a user package library?” above.
Why does rig set the default CRAN mirror?
To avoid the extra work the users need to spend on this.
The https://cloud.r-project.org mirror is usually better than the other, in that it is a CDN that is close to most users, and that it is updated more often.
If you want to use a different mirror, you can set the
reposoption in your.Rprofile, so the rig repo settings will be ignored.You can also use the
--without-cran-mirroroption ofrig add.
Why does rig set up P3M?
P3M (Posit Public Package Manager) is generally superior to a regular CRAN mirror on Windows and many Linux systems.
On Linux it includes binary packages for many popular distributions.
On Windows, it includes up to date binary packages for older R versions as well.
To avoid P3M use the
--without-p3moption (or the legacy--without-rspm) option ofrig add.
Can rig install R without admin permissions
Yes. rig has a user mode that installs everything into your home directory, so it never needs
sudoor administrator rights. In user mode rig installs R into~/.local/share/rig/r(%APPDATA%\rig\data\ron Windows) and creates quick links in~/.local/bin(%USERPROFILE%\.local\binon Windows), which need to be on yourPATH.
rig system user-modeswitches to user mode and migrates an existing admin-mode setup (seerig system user-mode --help).Use
rig config set mode=userandrig config set mode=adminto switch between user and admin mode.Alternatively, switch to user mode temporarily by setting the
RIG_MODE=userenvironment variable, or by passing the--userflag to any rig command.The default is still admin mode, which installs R system-wide and needs
sudo(or an administrator account on Windows).
How is rig different from RSwitch?
While there is a small overlap in functionality, rig and RSwitch are very different. I suggest you look over the features of both to decide which one suits your needs better.
If you like rig and also like the extra features of RSwitch, then you can use them together just fine: changing the default R version in RSwitch also changes it in rig and vice versa. You can use the rig cli and the RSwitch app together, or you can also use both menu bar apps at the same time.
Which domains does rig download files from?
Here is the list of domains that you need to enable in your proxy. Note that some of these, in particular the GitHub ones, might trigger redirects.
- https://api.r-hub.io/rversions for resolving R versions, i.e. this is needed for
rig install,rig available, etc.rig installdownloads pak from https://r-lib.github.io/p/pak unless requested otherwise.rig installsets https://cloud.r-project.org as the default CRAN mirror, unless requested otherwise.rig installsets https://packagemanager.posit.co as the Posit Package Manager CRAN mirror on supported Linux systems, unless requested otherwise.rig installdownloads the EPEL package from https://dl.fedoraproject.org/pub/epel on RHEL systems.rig rtoolsdownloads Rtools from the following URLs on Windows:
- https://github.com/r-hub/rtools44/releases,
- https://github.com/r-hub/rtools43/releases,
- https://github.com/r-hub/rtools42/releases,
- https://cloud.r-project.org/bin/windows/Rtools
- https://github.com/R-macos/gcc-darwin-arm64/releases, https://github.com/fxcoudert/gfortran-for-macOS/releases and whatever domains Homebrew is using, to download system packages for
rig sysreqson macOS.
Feedback
Please open an issue in our issue tracker at https://github.com/r-lib/rig/issues