Captures all package versions and saves lockfile.
Useful before major pipeline operations for reproducibility tracking.
Usage
snapshotEnvironment(versionLabel = NULL, savePath = NULL)
Arguments
- versionLabel
Character. Optional label for the snapshot (e.g., "v1.0.0").
Used in saved filename: renv_lock_versionLabel.json
- savePath
Character. Optional path to save versioned lockfile.
If NULL and versionLabel provided, saves to current directory.
Value
Character. Hash of lockfile contents for audit trail (invisibly)
Details
This function:
Updates renv.lock with current package state
Optionally saves versioned copy
Returns lockfile hash for audit/reproducibility tracking
Call before execStudyPipeline() or orchestratePipelineExport().