{"id":14065850,"url":"https://github.com/datasnakes/renv","last_synced_at":"2025-09-11T16:08:35.261Z","repository":{"id":57461157,"uuid":"134752906","full_name":"datasnakes/renv","owner":"datasnakes","description":"Creating virtual environments for R.","archived":false,"fork":false,"pushed_at":"2019-10-24T19:09:30.000Z","size":251,"stargazers_count":17,"open_issues_count":15,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-31T06:51:14.108Z","etag":null,"topics":["biohackathon","cli","hackathon","package-management","project-environment","python","r","renv","reproducible-research","virtual-environment"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datasnakes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-24T18:15:34.000Z","updated_at":"2023-11-07T12:48:48.000Z","dependencies_parsed_at":"2022-09-17T08:11:06.229Z","dependency_job_id":null,"html_url":"https://github.com/datasnakes/renv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasnakes%2Frenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasnakes%2Frenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasnakes%2Frenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasnakes%2Frenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datasnakes","download_url":"https://codeload.github.com/datasnakes/renv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238112937,"owners_count":19418535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biohackathon","cli","hackathon","package-management","project-environment","python","r","renv","reproducible-research","virtual-environment"],"created_at":"2024-08-13T07:04:46.192Z","updated_at":"2025-02-10T12:30:52.897Z","avatar_url":"https://github.com/datasnakes.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/renv.svg)](https://badge.fury.io/py/renv)\n[![Build Status](https://travis-ci.com/datasnakes/renv.svg?branch=master)](https://travis-ci.com/datasnakes/renv)\n\n# renv (beta)\n\nCreating virtual environments for R. (currently a Linux-only implementation)\n\n## Description\n\nOne of the problems with using R for data analysis can be dependency issues especially for\nscientists who use multiple versions of R or R packages and have a large number of\nprojects that they are developing with R. Dependency issues are especially prevalent among those individuals or groups\nthat are developing R packages.  `renv` is a [Python style](https://github.com/python/cpython/blob/3.6/Lib/venv/__init__.py)\nvirtual environment manager for creating virtual environments for R.\n\n## Installation\n\nThis package is being managed with [`poetry`](https://github.com/sdispater/poetry) and is also available on PyPi.\n\n```bash\npip install renv\n```\n\n## Usage\n\nRenv is currently in beta and is only supported in Linux so there may be some issues if your R has been\ninstalled in a way other than the default. There are probably plenty of\nunforeseen bugs, misspellings, and general use cases where the code could be\nmore efficient. Please submit an [issue](https://github.com/datasnakes/renv/issues)\nor [PR](https://github.com/datasnakes/renv/pulls). We'd love to get\ncommunity feedback.\n\nThe default .Rprofile also prompts you to install some commonly used\npackages. The functionality of this is useful, but will change for the\nactual release of this package.\n\n### Commands\n\nOnce you have renv installed, you need to initialize renv to set up the `.beRi/.renv` folder in your `$HOME` directory:\n\n```bash\nrenv init\n```\n\nNow, you can easily create an environment:\n\n```bash\nrenv -e myenv -r /path/to/R/folder # Find your current R folder is using `which R` on Linux.\n```\n\nAn environment folder named `myenv` will be created in `$HOME/.beRi/.renv`.\n\nTo activate the environment:\n```\ncd $HOME/.beRi/.renv/myenv/bin\n. ./activate \n```\n\nTo deactivate the R environment:\n\n```bash\ndeactivate\n```\n\n\nUse `--help` to see the other command-line options.\n\n```console\nuser@host:~$ renv --help\nUsage: renv [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -r, --r_home TEXT               Provide the root of the directory tree where\n                                  R is installed ($R_HOME).  This would be R's\n                                  installation directory when using\n                                  ./configure --prefix=\u003cr_home\u003e.  [required]\n  -e, --env_name TEXT             Name of the environment.  [required]\n  -p, --path TEXT                 An absolute installation path for renv.\n                                  [default: ~/.beRi]\n  -n, --name TEXT                 A directory name for renv.  [default: .renv]\n  -b, --bindir TEXT               Provide the bin directory if R was installed\n                                  when using ./configure --bindir=\u003cbinpath\u003e.\n  -l, --libdir TEXT               Provide the lib directory if R was installed\n                                  when using ./configure --libdir=\u003clibpath\u003e.\n  -i, --includedir TEXT           Provide the include directory if R was\n                                  installed when using ./configure\n                                  --includedir=\u003cincludepath\u003e.\n  -rp, --recommended_packages BOOLEAN\n                                  This determines wheather or not the\n                                  recommended packages are installed in theR\n                                  environment along with the base packages.\n                                  In most cases it's best to keep thedefault\n                                  value.\n  --clear BOOLEAN                 Deletes the contents of the environment\n                                  directory if it already exists, before\n                                  environment creation.\n  -u, --upgrade BOOLEAN           Upgrades the environment directory to use\n                                  this version of R.\n  -p, --prompt TEXT               Provide an alternative prompt prefix for\n                                  this environment.\n  -v, --verbose                   Show verbose cli output.\n  --help                          Show this message and exit.\n\nCommands:\n  init  Initialize renv using the \u003cpath\u003e/\u003cname\u003e.\n                         Show this message and exit.\n```\n\n\n### Creating an R Environment\n\n```console\nuser@host:~$ renv  -e ~/projects/rna-brain -r /usr/local/apps/R/R-3.4.4/\nuser@host:~$ source ~/projects/rna-brain/bin/activate\n(rna-brain) user@host:~$ R\n\nR version x.y.z (YYY-MM-DD) -- \"Dist\"\nCopyright (C) YYY The R Foundation for Statistical Computing\nPlatform: Renv is working for some linux distrubutions\n\nR is free software and comes with ABSOLUTELY NO WARRANTY.\nYou are welcome to redistribute it under certain conditions.\nType 'license()' or 'licence()' for distribution details.\n\nR is a collaborative project with many contributors.\nType 'contributors()' for more information and\n'citation()' on how to cite R or R packages in publications.\n\nType 'demo()' for some demos, 'help()' for on-line help, or\n'help.start()' for an HTML browser interface to help.\nType 'q()' to quit R.\n\n\n..................Attempting to Load Bioconductor...................\n\nWarning: Prompting for Bioconductor Installation...\n\nDo you want to install Bioconductor??? [Y/N]\nn\n\n..................Attempting to Load Devtools...................\n\nWarning: Prompting for Devtools Installation...\n\nDo you want to install Devtools??? [Y/N]\nn\n\n..................Attempting to Load Tidyverse...................\n\nWarning: Prompting for Tidyverse Installation...\n\nDo you want to install Tidyverse??? [Y/N]\nn\nWarning messages:\n1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :\n  there is no package called ‘BiocInstaller’\n2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :\n  there is no package called ‘devtools’\n3: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :\n  there is no package called ‘tidyverse’\n\u003e\n\n```\n## Features\n\n1.  Creates a default R virtual environment using default config settings\n    or a YAML file in the pre-existing environment directory.\n2.  Manages the user's and the environment's .Rprofile and .Renviron\n    files.\n\nBelow is an example of the YAML config file (there may be mistakes or\nmissing keys). Try to use absolute paths.\n\n```yaml\nR_ABS_HOME: \"/home/grabear/R-installs/R-3.4.3/lib64/R\"\nR_ENV_HOME: \"/home/grabear/rna-brain\"\nR_LIBS_USER: \"/home/grabear/rna-brain/lib64/R/library\"\nR_INCLUDE_DIR: \"/home/grabear/rna-brain/lib64/R/include\"\nR_VERSION: \"3.4.3\"\n\n# LIST OF DEFAULT variables for .Rprofile\nCRAN_MIRROR: \"https://cran.rstudio.com/\"\nCRANEXTRA_MIRROR: \"https://mirrors.nics.utk.edu/cran/\"\n\n# Determine how to format this for .Rprofile\nSTANDARD_PKG_LIST:\n  BiocInstaller: \"Bioconductor\"\n  devtools: \"Devtools\"\n  tidyverse: \"Tidyverse\"\n\nREPRODUCIBLE_WORKFLOW_PKG_LIST:\n  packrat: \"Packrat\"\n  miniCRAN: \"MiniCRAN\"\n```\n\n## Questions ???\n\n### Why renv?\n\nTools for creating reproducible workflows with R have been needed for a\nlong time. Renv gets its inspiration from\n[packrat](https://rstudio.github.io/packrat/), which allows you to\ncreate isolated package libraries, and python's\n[venv](https://docs.python.org/3/library/venv.html) module, which\ncreates an environment with its own package library **AND** python\nbinaries. Renv, therefore, helps user better manage a system with\nmultiple installations of R by creating a virtual environments for\nspecific versions of R that have their own R binaries (R and Rscript) as\nwell as their own isolated package libraries.\n\n### Why click and poetry?\n\nClick is used over argparse for speed of development. It requires an\nextra dependency, but it's easy to use and what we know. Poetry is used\nfor similar reasons. It's a developing project, so we may have regrets\nlater down the road, but for now it's proven to be a very useful tool.\n\n### Why not develop everything in R?\n\nAgain, we are going with what we know. We aren't unfamiliar with\nprogramming or making packages with R, but we are way better at\ndeveloping and maintaining python code. Virtual environments are already\nwidely used for the python language, which means we don't have to\nrecreate the _.whl_.\n\n## Maintainers\n\nRob Gilmore | [@grabear](https://github.com/grabear) | [✉](mailto:robgilmore127@gmail.com)  \nSantina Lin | [@santina](https://github.com/santina) | [✉](mailto:santina424@gmail.com)  \nShaurita Hutchins | [@sdhutchins](https://github.com/sdhutchins) | [✉](mailto:sdhutchins@outlook.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasnakes%2Frenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatasnakes%2Frenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasnakes%2Frenv/lists"}