Skip to content

r_version

The R version to install packages for, containing at least the major and minor versions.

The R version is found on the system according to the following guidelines:

rv utilizes a flexible version matching approach, similar to Posit Connect’s major-minor approach. If the patch version is specified, it will perform an exact match. If the patch version is not specified, it will match to any R version found with the same major and minor version.

For example, if R 4.5.0 and 4.5.1 are found on the system, the following matches will occur:

  • r_version = "4.5"4.5.0 and 4.5.1
  • r_version = "4.5.0"4.5.0

Since R packages are compatible across patch versions of R, it is recommended to specify only the major and minor version to increase cross-system compatibility.

rv will look to find the specified versions of R first on the path, then in the following locations based on OS:

  • Linux - Searches within the subdirectories of /opt/R (i.e. /opt/R/4.5.0/bin/R)
  • MacOs - rig keeps all installed versions of R on the path as R-<MAJOR>.<MINOR>-arch. If the executable exists, will check the version to ensure it matches the specified version, even if it is not the version selected by rig.
  • Windows - rig keeps the installed/selected version as R.bat, therefore we check for R.bat on the path as well.