All Projects → datasnakes → renv

datasnakes / renv

Licence: MIT license
Creating virtual environments for R.

Programming Languages

python
139335 projects - #7 most used programming language
r
7636 projects
shell
77523 projects
Roff
2310 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to renv

Projectweek
Website for NA-MIC Project Weeks
Stars: ✭ 31 (+72.22%)
Mutual labels:  hackathon, reproducible-research
benchmark VAE
Unifying Variational Autoencoder (VAE) implementations in Pytorch (NeurIPS 2022)
Stars: ✭ 1,211 (+6627.78%)
Mutual labels:  reproducible-research
Naver-AI-Hackathon-Speech
2019 Clova AI Hackathon : Speech - Rank 12 / Team Kai.Lib
Stars: ✭ 26 (+44.44%)
Mutual labels:  hackathon
Rmarkdown tutorial
Reproducible Research with Rmarkdown: data management, analysis, and reporting all-in-one
Stars: ✭ 18 (+0%)
Mutual labels:  reproducible-research
registration
✏️ Hackathon registration server
Stars: ✭ 60 (+233.33%)
Mutual labels:  hackathon
rcompendium
📦 Create a package or compendium structure
Stars: ✭ 26 (+44.44%)
Mutual labels:  reproducible-research
hackathons
Tips, Tricks, and Resources for running your hackathon.
Stars: ✭ 238 (+1222.22%)
Mutual labels:  hackathon
holo-build
Cross-distribution system package compiler
Stars: ✭ 43 (+138.89%)
Mutual labels:  package-management
libdnf
Package management library.
Stars: ✭ 157 (+772.22%)
Mutual labels:  package-management
orion flutterhack20
Cross-platform mobile app with maps and camera integration.
Stars: ✭ 24 (+33.33%)
Mutual labels:  hackathon
Data-Science-Hackathon-And-Competition
Grandmaster in MachineHack (3rd Rank Best) | Top 70 in AnalyticsVidya & Zindi | Expert at Kaggle | Hack AI
Stars: ✭ 165 (+816.67%)
Mutual labels:  hackathon
groundhog
Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
Stars: ✭ 58 (+222.22%)
Mutual labels:  reproducible-research
soulcare
🔥 A centralised health care system that tracks each dose given to the patient by the nurse. Also let's specialist doctors respond to the patient immediately via logs generated.
Stars: ✭ 23 (+27.78%)
Mutual labels:  hackathon
sih2k18
🦄Winner: Smart India Hackathon 2018 🌷
Stars: ✭ 41 (+127.78%)
Mutual labels:  hackathon
papeR
A toolbox for writing Sweave or other LaTeX-based papers and reports and to prettify the output of various estimated models.
Stars: ✭ 26 (+44.44%)
Mutual labels:  reproducible-research
targets-tutorial
Short course on the targets R package
Stars: ✭ 87 (+383.33%)
Mutual labels:  reproducible-research
purescript.nix
📦 PureScript package management with Nix
Stars: ✭ 12 (-33.33%)
Mutual labels:  package-management
Bitcamp-2019
Won the most innovative solution at Bitcamp 2019.🎖🎉
Stars: ✭ 15 (-16.67%)
Mutual labels:  hackathon
Kervolution
Kervolution implementation using TF2.0
Stars: ✭ 20 (+11.11%)
Mutual labels:  reproducible-research
rust
RustPräzi: Representing crates.io as a call-based dependency network
Stars: ✭ 77 (+327.78%)
Mutual labels:  package-management

PyPI version Build Status

renv (beta)

Creating virtual environments for R. (currently a Linux-only implementation)

Description

One of the problems with using R for data analysis can be dependency issues especially for scientists who use multiple versions of R or R packages and have a large number of projects that they are developing with R. Dependency issues are especially prevalent among those individuals or groups that are developing R packages. renv is a Python style virtual environment manager for creating virtual environments for R.

Installation

This package is being managed with poetry and is also available on PyPi.

pip install renv

Usage

Renv is currently in beta and is only supported in Linux so there may be some issues if your R has been installed in a way other than the default. There are probably plenty of unforeseen bugs, misspellings, and general use cases where the code could be more efficient. Please submit an issue or PR. We'd love to get community feedback.

The default .Rprofile also prompts you to install some commonly used packages. The functionality of this is useful, but will change for the actual release of this package.

Commands

Once you have renv installed, you need to initialize renv to set up the .beRi/.renv folder in your $HOME directory:

renv init

Now, you can easily create an environment:

renv -e myenv -r /path/to/R/folder # Find your current R folder is using `which R` on Linux.

An environment folder named myenv will be created in $HOME/.beRi/.renv.

To activate the environment:

cd $HOME/.beRi/.renv/myenv/bin
. ./activate 

To deactivate the R environment:

deactivate

Use --help to see the other command-line options.

user@host:~$ renv --help
Usage: renv [OPTIONS] COMMAND [ARGS]...

Options:
  -r, --r_home TEXT               Provide the root of the directory tree where
                                  R is installed ($R_HOME).  This would be R's
                                  installation directory when using
                                  ./configure --prefix=<r_home>.  [required]
  -e, --env_name TEXT             Name of the environment.  [required]
  -p, --path TEXT                 An absolute installation path for renv.
                                  [default: ~/.beRi]
  -n, --name TEXT                 A directory name for renv.  [default: .renv]
  -b, --bindir TEXT               Provide the bin directory if R was installed
                                  when using ./configure --bindir=<binpath>.
  -l, --libdir TEXT               Provide the lib directory if R was installed
                                  when using ./configure --libdir=<libpath>.
  -i, --includedir TEXT           Provide the include directory if R was
                                  installed when using ./configure
                                  --includedir=<includepath>.
  -rp, --recommended_packages BOOLEAN
                                  This determines wheather or not the
                                  recommended packages are installed in theR
                                  environment along with the base packages.
                                  In most cases it's best to keep thedefault
                                  value.
  --clear BOOLEAN                 Deletes the contents of the environment
                                  directory if it already exists, before
                                  environment creation.
  -u, --upgrade BOOLEAN           Upgrades the environment directory to use
                                  this version of R.
  -p, --prompt TEXT               Provide an alternative prompt prefix for
                                  this environment.
  -v, --verbose                   Show verbose cli output.
  --help                          Show this message and exit.

Commands:
  init  Initialize renv using the <path>/<name>.
                         Show this message and exit.

Creating an R Environment

user@host:~$ renv  -e ~/projects/rna-brain -r /usr/local/apps/R/R-3.4.4/
user@host:~$ source ~/projects/rna-brain/bin/activate
(rna-brain) user@host:~$ R

R version x.y.z (YYY-MM-DD) -- "Dist"
Copyright (C) YYY The R Foundation for Statistical Computing
Platform: Renv is working for some linux distrubutions

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


..................Attempting to Load Bioconductor...................

Warning: Prompting for Bioconductor Installation...

Do you want to install Bioconductor??? [Y/N]
n

..................Attempting to Load Devtools...................

Warning: Prompting for Devtools Installation...

Do you want to install Devtools??? [Y/N]
n

..................Attempting to Load Tidyverse...................

Warning: Prompting for Tidyverse Installation...

Do you want to install Tidyverse??? [Y/N]
n
Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘BiocInstaller’
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘devtools’
3: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘tidyverse’
>

Features

  1. Creates a default R virtual environment using default config settings or a YAML file in the pre-existing environment directory.
  2. Manages the user's and the environment's .Rprofile and .Renviron files.

Below is an example of the YAML config file (there may be mistakes or missing keys). Try to use absolute paths.

R_ABS_HOME: "/home/grabear/R-installs/R-3.4.3/lib64/R"
R_ENV_HOME: "/home/grabear/rna-brain"
R_LIBS_USER: "/home/grabear/rna-brain/lib64/R/library"
R_INCLUDE_DIR: "/home/grabear/rna-brain/lib64/R/include"
R_VERSION: "3.4.3"

# LIST OF DEFAULT variables for .Rprofile
CRAN_MIRROR: "https://cran.rstudio.com/"
CRANEXTRA_MIRROR: "https://mirrors.nics.utk.edu/cran/"

# Determine how to format this for .Rprofile
STANDARD_PKG_LIST:
  BiocInstaller: "Bioconductor"
  devtools: "Devtools"
  tidyverse: "Tidyverse"

REPRODUCIBLE_WORKFLOW_PKG_LIST:
  packrat: "Packrat"
  miniCRAN: "MiniCRAN"

Questions ???

Why renv?

Tools for creating reproducible workflows with R have been needed for a long time. Renv gets its inspiration from packrat, which allows you to create isolated package libraries, and python's venv module, which creates an environment with its own package library AND python binaries. Renv, therefore, helps user better manage a system with multiple installations of R by creating a virtual environments for specific versions of R that have their own R binaries (R and Rscript) as well as their own isolated package libraries.

Why click and poetry?

Click is used over argparse for speed of development. It requires an extra dependency, but it's easy to use and what we know. Poetry is used for similar reasons. It's a developing project, so we may have regrets later down the road, but for now it's proven to be a very useful tool.

Why not develop everything in R?

Again, we are going with what we know. We aren't unfamiliar with programming or making packages with R, but we are way better at developing and maintaining python code. Virtual environments are already widely used for the python language, which means we don't have to recreate the .whl.

Maintainers

Rob Gilmore | @grabear |
Santina Lin | @santina |
Shaurita Hutchins | @sdhutchins |

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].