Skip to content

Commit

Permalink
Added badges to README and updated instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhutchins committed Apr 13, 2019
1 parent 1de261e commit 59776f2
Showing 1 changed file with 34 additions and 39 deletions.
73 changes: 34 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![PyPI version](https://badge.fury.io/py/renv.svg)](https://badge.fury.io/py/renv)
[![Build Status](https://travis-ci.com/datasnakes/renv.svg?branch=master)](https://travis-ci.com/datasnakes/renv)

# renv (beta)

Creating virtual environments for R. (currently a Linux-only implementation)
Expand All @@ -12,24 +15,10 @@ virtual environment manager for creating virtual environments for R.

## Installation

This package is being managed with [`poetry`](https://github.com/sdispater/poetry).
This package is being managed with [`poetry`](https://github.com/sdispater/poetry) and is also available on PyPi.

```bash
# Clone the repository
git clone https://github.com/datasnakes/renv.git

cd renv

# Make sure you have activated an environment of Python >= 3.6

# Get poetry and build the project using it
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

poetry install

poetry build

pip install dist/renv-0.2.0-py2.py3-none-any.whl
pip install renv
```

## Usage
Expand All @@ -47,17 +36,23 @@ actual release of this package.

### Commands

Once you have renv installed, you can create an R environment by a simple command:
Once you have renv installed, you need to initialize renv to set up the `.beRi/.renv` folder in your `$HOME` directory:

```bash
renv init
```

Now, you can easily create an environment:

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

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

To activate the environment
To activate the environment:
```
cd $HOME\.renv\myenv\bin
cd $HOME/.beRi/.renv/myenv/bin
. ./activate
```

Expand All @@ -71,28 +66,25 @@ deactivate
Use `--help` to see the other command-line options.

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

Options:
-r, --r_home TEXT Provide the root of the directory tree where
R is installed. This would be R's
R is installed ($R_HOME). This would be R's
installation directory when using
./configure --prefix=<r_home>.
-n, --env_name TEXT Name of the environment.
-d, --env_home TEXT A directory for creating the environment in.
-b, --binpath TEXT Provide the bin directory if R was installed
./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, --libpath TEXT Provide the lib directory if R was installed
-l, --libdir TEXT Provide the lib directory if R was installed
when using ./configure --libdir=<libpath>.
-i, --includepath TEXT Provide the include directory if R was
-i, --includedir TEXT Provide the include directory if R was
installed when using ./configure
--includedir=<includepath>.
-sp, --system_site_packages BOOLEAN
This determines whether or not the
R_LIBS_USER environment variable utilizes
the original R's package library as a
secondary source for loading packages.
-rp, --recommended_packages BOOLEAN
This determines wheather or not the
recommended packages are installed in theR
Expand All @@ -107,16 +99,19 @@ Options:
-p, --prompt TEXT Provide an alternative prompt prefix for
this environment.
-v, --verbose Show verbose cli output.
-V, --version Show the version of renv and exit.
--help Show this message and exit.

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


### Creating an R Environment

```console
user@host:~$ renv -r /usr/local/R -d ~/projects/rna-brain
user@host:~$ source projects/rna-brain/bin/activate
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"
Expand Down Expand Up @@ -198,7 +193,7 @@ REPRODUCIBLE_WORKFLOW_PKG_LIST:
miniCRAN: "MiniCRAN"
```
## Questions
## Questions ???
### Why renv?
Expand Down

0 comments on commit 59776f2

Please sign in to comment.