renvLecture 20
College of Idaho
CSCI 2025 - Winter 2026
renv?renv is the standard tool for this.renv Worksrenv/library) instead of the system library.renv.lock): A JSON file recording the exact version and source of every package.renv/activate.R): Automatically loads the project environment when you open the project.renv::init()install.packages(), write coderenv::snapshot()renv::restore()renv::init() to start using renv in a project.renv.lock) with currently installed packages..Rprofile to activate renv on startup.install.packages("dplyr")install.packages("ggplot2")renv::snapshot()renv.lock with the versions you are currently using.renv.lock to Git!renv).renv::restore().renv.lock.renv::status() to see if your library matches your lockfile.renv.lock.Rprofilerenv/activate.Rrenv/settings.json (if it exists)renv/library (these are the installed files, which are large and platform-specific)renv/python (if using Python)renv/stagingrenv for every serious project.init() to start.snapshot() to save.restore() to load.