renv Lock File Comparison

Overview

The renv lock comparison workflow compares two renv lock files, identifies package version differences, runs compare_package_versions for each changed package, and produces a risk assessment report with dependency and function changes.

Running the Comparison

library(whatsnew)

Source the comparison script and run it. Uses defaults when called with no arguments (lock files from package, output to tempdir()):

source(system.file("script/compare_renv_lock.R", package = "whatsnew"))
compare_renv_lock_files()  # Uses default lock files and tempdir() for output

# Or with explicit paths:
compare_renv_lock_files(
  lock_old = system.file("env/renv_Rforsub_old.lock", package = "whatsnew"),
  lock_new = system.file("env/renv_Rforsub.lock", package = "whatsnew"),
  result_path = tempdir()
)

Note: compare_renv_lock_files() downloads package metadata from CRAN via compare_package_versions(). Run the above in an interactive session when network access is available.

Report Output

Below is an example report generated from the lock files shipped with the package:

renv Lock File Comparison Report

Generated: 2026-03-23 15:11:14

Run Parameters

Summary

Version Changes

 name version_old version_new

19 cli 3.6.2 3.6.3 36 dplyr 1.1.3 1.1.4 103 purrr 1.0.1 1.0.2 123 rlang 1.1.3 1.1.4

Compare Status

Package Reports

cli (3.6.2 → 3.6.3)

  • Risk level: low
  • Recommendation: Usually safe; quick review recommended.

dplyr (1.1.3 → 1.1.4)

  • Risk level: medium
  • Recommendation: Review diffs; run smoke tests before upgrade.

Dependency risks:

  • Imports_modified [low-medium]: vctrs: >= 0.6.0 -> >= 0.6.4 — Cascading update; run compare on those packages.

Function risks:

  • modified_optional_only [low]: import_vctrs, import_from — Backward compatible if defaults are sensible.

Imports:

  • Modified: vctrs: >= 0.6.0 -> >= 0.6.4

Functions (Added) with params:

  • stop_invalid_namespaced_expression(expr, i, call)

  • rethrow_error_join_matches_overflow(cnd, call)

Functions (Modified) - params changed:

  • import_vctrs:
    • 1.1.3: (name)
    • 1.1.4: (name, optional = FALSE)
  • import_from:
    • 1.1.3: (name, package)
    • 1.1.4: (name, package, optional = FALSE)

purrr (1.0.1 → 1.0.2)

  • Risk level: high
  • Recommendation: Manual review and regression tests before upgrade.

Actions: - Depends changed: may require environment updates.

Dependency risks:

  • Depends_modified [low-medium]: R: >= 3.4.0 -> >= 3.5.0 — Cascading update; run compare on those packages.

  • Imports_modified [low-medium]: cli: >= 3.4.0 -> >= 3.6.1, rlang: >= 0.4.10 -> >= 1.1.1, vctrs: >= 0.5.0 -> >= 0.6.3 — Cascading update; run compare on those packages.

Function risks:

  • added [low]: defer — New API only.

Depends:

  • Modified: R: >= 3.4.0 -> >= 3.5.0

Imports:

  • Modified: cli: >= 3.4.0 -> >= 3.6.1, rlang: >= 0.4.10 -> >= 1.1.1, vctrs: >= 0.5.0 -> >= 0.6.3

Functions (Added) with params:

  • defer(expr, env = caller_env(), after = FALSE)

rlang (1.1.3 → 1.1.4)

  • Risk level: low
  • Recommendation: Usually safe; quick review recommended.

Function risks:

  • added [low]: dyn_lgl_push_back, dyn_int_push_back, dyn_dbl_push_back, dyn_cpl_push_back, dyn_raw_push_back, dyn_chr_push_back, dyn_list_push_back — New API only.

Functions (Added) with params:

  • dyn_lgl_push_back(x, value)

  • dyn_int_push_back(x, value)

  • dyn_dbl_push_back(x, value)

  • dyn_cpl_push_back(x, value)

  • dyn_raw_push_back(x, value)

  • dyn_chr_push_back(x, value)

  • dyn_list_push_back(x, value)

Output

Output Files

The comparison writes to result_path/renv_lock_comparison/: