renv}renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022
renv} | RRTM, 15.03.2022
renv} | RRTM, 15.03.2022
Time-consuming and frustrating issue (typically after updating)
renv} | RRTM, 15.03.2022
Time-consuming and frustrating issue (typically after updating)
quote from and with permission of Lauriane
Describe the internal setup and interrelations between R, RStudio, R packages and their versions
Describe the internal setup and interrelations between R, RStudio, R packages and their versions
Present a conceptual solution & technical framework designed to tackle the issue:
- Isolated project-libraries with {
renv}
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 Versions to report in a publication
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 1use .libPaths() to check where, 2stored = install.packages(), 3looked up = library()
renv} | RRTM, 15.03.2022 1use .libPaths() to check where, 2stored = install.packages(), 3looked up = library()
ggplot2} 3.3.5 == 2.3.9renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 ggplot2} has got 30 dependencies:

Fig.source: RStudio, February 2022
renv} | RRTM, 15.03.2022 ggplot2} has got 30 dependencies:

Fig.source: RStudio, February 2022
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 Example
library()): library(ggplot2) # powerful plotting librarylibrary(lme4) # multi-level modellinglibrary(naniar) # dealing with missing valuesrenv} | RRTM, 15.03.2022 Example
library()): library(ggplot2) # powerful plotting librarylibrary(lme4) # multi-level modellinglibrary(naniar) # dealing with missing values
renv} | RRTM, 15.03.2022 Example
library()): library(ggplot2) # powerful plotting librarylibrary(lme4) # multi-level modellinglibrary(naniar) # dealing with missing values
Usual analysis
renv} | RRTM, 15.03.2022 Example
library()): library(ggplot2) # powerful plotting librarylibrary(lme4) # multi-level modellinglibrary(naniar) # dealing with missing values
Usual analysis
Explicit use of 10-15 packages
Implicit interrelations are difficult to gasp & impossible to track by hand
renv} | RRTM, 15.03.2022 Example
library()): library(ggplot2) # powerful plotting librarylibrary(lme4) # multi-level modellinglibrary(naniar) # dealing with missing values
Usual analysis
Explicit use of 10-15 packages
Implicit interrelations are difficult to gasp & impossible to track by hand
Issue: (recommended) update unintended consequence
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 Isolated project-libraries (also called environments)
renv} | RRTM, 15.03.2022 Isolated project-libraries (also called environments)
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 further info: https://environments.rstudio.com/, https://peps.python.org/pep-0405/
renv} | RRTM, 15.03.2022 further info: https://environments.rstudio.com/, https://peps.python.org/pep-0405/
renv} | RRTM, 15.03.2022 further info: https://environments.rstudio.com/, https://peps.python.org/pep-0405/
Fundamentally different to 'usual' interaction with a computer:
renv} | RRTM, 15.03.2022 further info: https://environments.rstudio.com/, https://peps.python.org/pep-0405/
Fundamentally different to 'usual' interaction with a computer:
renv} | RRTM, 15.03.2022 renv}renv} | RRTM, 15.03.2022 renv}Kevin Ushey (2022). renv: Project Environments. R package version 0.15.2.
renv} | RRTM, 15.03.2022 renv}Kevin Ushey (2022). renv: Project Environments. R package version 0.15.2.

What do I see when using {renv}?
a subfolder renv that contains the isolated library
(useful on your computer)
a lockfile renv.lock where all versions are documented
(useful for creating the same library on another computer)
renv} | RRTM, 15.03.2022 renv} | RRTM, 15.03.2022 renv} is not a uniform solution to computational reproducibilityrenv} | RRTM, 15.03.2022 {renv} is not a uniform solution to computational reproducibility
Alternatives are available - require more technical know-how
renv} | RRTM, 15.03.2022 {renv} is not a uniform solution to computational reproducibility
Alternatives are available - require more technical know-how
{renv} offers a lightweight & manageable solution to
setup and use multiple libraries across your computer
easily document all versions and dependencies of packages
share your environment-setup with other collaborators
renv}Official documentation: https://rstudio.github.io/renv/articles/renv.html
1) Open the .Rproj-file of the desired analysis-folder
2) Call install.packages("renv")
3) Call renv::init()
this creates the subfolder and the
renv.lock-file{
renv} interacts with you in the console & prints what it does
4) Continue working as usual - if you need to install further packages, they are installed in the project-library
5) From time to time: call renv::snapshot()
adds all the packages used in this project to the
renv.lock-file
Setup tested with {renv} 0.15.2, R Version 4.1.3 on Mac OS X 12.2.1
base}-Rrenv} ?renv} ?renv} | RRTM, 15.03.2022 Keyboard shortcuts
| ↑, ←, Pg Up, k | Go to previous slide |
| ↓, →, Pg Dn, Space, j | Go to next slide |
| Home | Go to first slide |
| End | Go to last slide |
| Number + Return | Go to specific slide |
| b / m / f | Toggle blackout / mirrored / fullscreen mode |
| c | Clone slideshow |
| p | Toggle presenter mode |
| t | Restart the presentation timer |
| ?, h | Toggle this help |
| Esc | Back to slideshow |