r_version
The R version to install packages for, containing at least the major and minor versions.
Finding the Executable
Section titled “Finding the Executable”The R version is found on the system according to the following guidelines:
Version Matching
Section titled “Version Matching”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.0and4.5.1r_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.
Known Binary Locations
Section titled “Known Binary Locations”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 -
rvlooks forRon 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/ris not scanned. - Windows - rig keeps the installed/selected version as R.bat, therefore we check for
R.baton the path first. If not found there,rvalso scansC:\Program Files\R\R-*.
use_devel
Section titled “use_devel”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 = truerepositories = [ { alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" },]dependencies = [ "dplyr",]Default:
false