Skip to content

rv export renv

Introduced in rv v0.21.0

Exports an rv project’s lock file to renv.lock format, acting as an escape hatch back to renv if needed.

Terminal window
rv export renv [OPTIONS]
  • --output (-o) - Path to write the renv.lock file to.

    Default: renv.lock

Most package sources map directly to their renv.lock equivalent (CRAN-style repository packages, git, and local sources). A couple of sources are converted rather than mapped 1:1:

  • R-universe sources are converted to renv’s GitHub/git source, pinned to the exact commit rv resolved. R-universe is a rolling build that doesn’t preserve historical versions, so this ensures the exported lock file reproduces exactly what was installed, rather than pointing at a build that may no longer exist.
  • URL sources have no direct renv equivalent and are mapped as a Repository source with a RemoteUrl field. A warning is reported for each package converted this way.

Any package that couldn’t be converted cleanly is reported as a warning; the export otherwise still succeeds.

Terminal window
% rv export renv
WARNING: `mypkg`: URL source `https://example.com/mypkg_1.0.0.tar.gz` has no direct renv equivalent, mapped as Repository with RemoteUrl
Successfully exported to renv.lock