Overview
The renv package1 helps you createreproducibleenvironments for your R projects. Use renv to make your R projects more isolated, portable and reproducible.
- Isolated: Installing a new or updated package for one project won’t break your other projects, and vice versa. That’s because renv gives each project its own private library.
- Portable: Easily transport your projects from one computer to another, even across different platforms. renv makes it easy to install the packages your project depends on.
- Reproducible: renv records the exact package versions you depend on, and ensures those exact versions are the ones that get installed wherever you go.
Installation
Install the latest version of renv from CRAN with:
install.packages("renv")Alternatively, install the development version fromr-universe with:
install.packages("renv", repos="https://rstudio.r-universe.dev")Workflow

Userenv::init() to initialize renv in a new or existing project. This will set up aproject library, containing all the packages you’re currently using. The packages (and all the metadata needed to reinstall them) are recorded into alockfile,renv.lock, and a.Rprofile ensures that the library is used every time you open that project.
As you continue to work on your project, you will install and upgrade packages, either usinginstall.packages() andupdate.packages() orrenv::install() andrenv::update(). After you’ve confirmed your code works as expected, userenv::snapshot() to record the packages and their sources in the lockfile.
Later, if you need to share your code with someone else or run your code on new machine, your collaborator (or you) can callrenv::restore() to reinstall the specific package versions recorded in the lockfile.
Learning more
If this is your first time using renv, we strongly recommend starting with theIntroduction to renv vignette: this will help you understand the most important verbs and nouns of renv.
If you have a question about renv, please first check theFAQ to see whether your question has already been addressed. If it hasn’t, please feel free to ask on thePosit Forum.
If you believe you’ve found a bug in renv, please file a bug (and, if possible, areproducible example) athttps://github.com/rstudio/renv/issues.