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 - rv looks for R on the path first; if it isn’t found there, or the version found doesn’t match, it also scans /Library/Frameworks/R.framework/Versions/* (the layout used by the CRAN installer) and /opt/homebrew/Cellar/r/* (Apple Silicon Homebrew installs). Intel Homebrew’s /usr/local/Cellar/r is not scanned.
  • Windows - rig keeps the installed/selected version as R.bat, therefore we check for R.bat on the path first. If not found there, rv also scans C:\Program Files\R\R-*.
Introduced in rv v0.18.0

If you are running an R-devel build (identified by a non-empty status field in R’s Rversion.h), set use_devel = true alongside r_version so rv matches against that devel installation instead of a released version with the same major/minor version.

[project]
name = "devel project"
r_version = "4.6"
use_devel = true
repositories = [
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" },
]
dependencies = [
"dplyr",
]

Default: false