install.packages("renv")
using renv to manage R packages in a project
Introduction
renv is a package that helps you manage R packages in a project. renv enables you to create a project-specific library of R packages. It is very flexible, allowing you to use any R package repository, including CRAN, Bioconductor, and GitHub.
Installation
renv is available on CRAN, so you can install it with install.packages()
:
Restore a previously saved project
::restore() renv
Initializing a project
::init() renv
When packages have been changed
::snapshot() renv
Change renv .cache location
Check here for more information: https://rstudio.github.io/renv/reference/paths.html
Sys.setenv(RENV_PATHS_ROOT = "<new_directory>/_cache_R")