renv_switch_r_version: Switch between R versions in renv projects

View source: R/renv.R

renv_switch_r_versionR Documentation

Switch between R versions in renv projects

Description

This function switches between R versions in renv projects which follow the 'cynkra RSPM snapshot' logic. This means that each R version is tied to a specific RSPM snapshot.

The function executes the following tasks:

  • Replace the R Version in renv.lock.

  • Replace the RSPM snapshot in renv.lock with the one associated with the selected R Version.

  • (optional) execution of renv::update().

  • (optional) execution of renv::snapshot().

Usage

renv_switch_r_version(version = NULL)

Arguments

version

⁠[character]⁠
The R version to upgrade to.

Value

TRUE (invisibly)

See Also

get_snapshots

Examples

## Not run: 
renv_switch_r_version("4.0.4")

## End(Not run)

cynkra/cynkrathis documentation built on June 14, 2025, 4:26 p.m.