Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rstudio/renv
renv: Project environments for R.
https://github.com/rstudio/renv
Last synced: 3 days ago
JSON representation
renv: Project environments for R.
- Host: GitHub
- URL: https://github.com/rstudio/renv
- Owner: rstudio
- License: mit
- Created: 2018-11-28T20:25:39.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T18:28:54.000Z (7 months ago)
- Last Synced: 2024-05-22T18:29:11.780Z (7 months ago)
- Language: R
- Homepage: https://rstudio.github.io/renv/
- Size: 20.3 MB
- Stars: 965
- Watchers: 46
- Forks: 152
- Open Issues: 131
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - renv - Create isolated, portable, and reproducible environments for R projects. (Miscellaneous / Dependency Resolution)
- awesome-starred - rstudio/renv - renv: Project environments for R. (others)
- jimsghstars - rstudio/renv - renv: Project environments for R. (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# renv
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![CRAN status](https://www.r-pkg.org/badges/version/renv)](https://CRAN.R-project.org/package=renv) [![R-CMD-check](https://github.com/rstudio/renv/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/renv/actions)
## Overview
The renv package[^1] helps you create **r**eproducible **env**ironments for your R projects.
Use renv to make your R projects more isolated, portable and reproducible.[^1]: Pronounced "R" "env"
- **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:
``` r
install.packages("renv")
```## Workflow
```{r}
#| echo: false
#| fig.align: center
#| out.width: null
#| fig.alt: >
#| A diagram showing the most important verbs and nouns of renv.
#| Projects start with init(), which creates a project library using
#| packages from the system library. snapshot() updates the lockfile
#| using the packages installed in the project library, where restore()
#| installs packages into the project library using the metadata from
#| the lockfile, and status() compares the lockfile to the project library.
#| You install and update packages from CRAN and GitHub using install()
#| and update(), but because you'll need to do this for multiple projects,
#| renv uses cache to make this fast.
knitr::include_graphics("vignettes/renv.png", dpi = 144)
```Use `renv::init()` to initialize renv in a new or existing project.
This will set up a **project library**, containing all the packages you're currently using.
The packages (and all the metadata needed to reinstall them) are recorded into a **lockfile**, `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 using `install.packages()` and `update.packages()` or `renv::install()` and `renv::update()`.
After you've confirmed your code works as expected, use `renv::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 call `renv::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 the [Introduction to renv](https://rstudio.github.io/renv/articles/renv.html) vignette: this will help you understand the most important verbs and nouns of renv.
If you have a question about renv, please first check the [FAQ](https://rstudio.github.io/renv/articles/faq.html) to see whether your question has already been addressed.
If it hasn't, please feel free to ask on the [Posit Forum](https://forum.posit.co).If you believe you've found a bug in renv, please file a bug (and, if possible, a [reproducible example](https://reprex.tidyverse.org)) at .