Set the renv lockfile CRAN repository URL to a Posit Package Manager (PPM) snapshot date
following PPM set up instructions,
for example, https://packagemanager.posit.co/cran/2026-08-04.
Usage
update_ppm_snapshot(cooldown = 7, prompt = rlang::is_interactive())Arguments
- cooldown
Number of days ago to set the PPM snapshot date.
- prompt
Boolean; prompt the user before updating renv::lockfiles?
Value
Results of renv::lockfile_write(), invisibly
Details
Using a PPM snapshot offers two key advantages:
Faster restores and greater reproducibility using
renv::restore(), since renv will restore the PPM archived macOS and Windows binaries from that date, which will not be available athttps://packagemanager.posit.co/cran/latestif newer versions have been published.The snapshot date can be used to implement a CRAN dependency cooldown, which delays installing the latest version of packages unless they are at least N days old, (typically 7), providing some protection against supply chain attacks.
