Exercises
Put what you’ve learned into practice with hands-on walkthroughs. Each exercise provides step-by-step instructions and highlights common pitfalls.
- Init and Snapshot — Initialize {renv} in a project and take a snapshot of its dependencies.
- Restore — Recreate a project environment from an existing lockfile.
- Explicitly Record — Manually record packages in the lockfile using
dependencies()andrecord().
These exercises use the intro-to-renv-exercises companion repository. Forking and cloning it is recommended but not required.
Note
Make sure to download the introduction-to-renv-exercises repository first! To do that, you can follow the previously-learned directions for creating a new RStudio project, and use this link https://github.com/lmu-osc/introduction-to-renv-exercises.
Alternatively, at the command line:
# change to the directory where you want the repo first! use the "cd PATH" command to do this
git clone git@github.com:lmu-osc/introduction-to-renv-exercises.git