Learn R Programming

⚠️There's a newer version (1.1.5) of this package.Take me there.

renv

Overview

The renv package helps you create reproducible environments for your R projects. Use renv to make your R projects more:

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 package 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.

See the project page for more information.

Installation

Install the latest development version of renv with:

if (!requireNamespace("remotes"))
  install.packages("remotes")

remotes::install_github("rstudio/renv")

Workflow

Use renv::init() to initialize renv with a new or existing project. This will set up your project with a private library, and also make sure to install all of the packages you're using into that library. The packages used in your project will be recorded into a lockfile, called renv.lock.

As you work in your project, you may need to install or upgrade different packages. As these packages are installed, renv will automatically write renv.lock for you. The renv.lock lockfile records the state of your project's private library, and can be used to restore the state of that library as required.

Later, if you need to port your project to a new machine, you can call renv::restore() to reinstall all of the packages as declared in the lockfile.

Copy Link

Version

Install

install.packages('renv')

Monthly Downloads

632,576

Version

0.7.0-25

License

MIT + file LICENSE

Maintainer

Kevin Ushey

Last Published

July 25th, 2025

Functions in renv (0.7.0-25)

isolate

Isolate a Project
renv-package

Project-local Environments for R
remove

Remove Packages
modify

Open the Lockfile for Editing
paths

Path Customization
restore

Restore a Project
init

Initialize a Project
use_python

Use Python
revert

Revert Lockfile
deactivate

Deactivate a Project
install

Install Packages
load

Load a Project
run

Run a Script
lockfile

Lockfiles
migrate

Migrate a Project from Packrat to renv
settings

Project Settings
upgrade

Upgrade renv
refresh

Refresh the Local Cache of Packages Available on CRAN
rebuild

Rebuild the Packages in your Project Library
update

Update Packages
project

Retrieve the Active Project
snapshot

Snapshot a Project
purge

Purge Packages from the Cache
status

Status
clean

Clean a Project
activate

Activate a Project
dependencies

Find R Package Dependencies in a Project
history

View Lockfile History
bootstrap

Bootstrap an renv Installation
consent

Consent to usage of renv
config

User-Level Configuration of renv
equip

Install Required System Libraries
hydrate

Hydrate a Project