An open API service indexing awesome lists of open source software.

https://github.com/INWTlab/r-config

R installation and configuration. We have moved this configuration into ansible. This repo is no longer maintained.
https://github.com/INWTlab/r-config

Last synced: 4 months ago
JSON representation

R installation and configuration. We have moved this configuration into ansible. This repo is no longer maintained.

Awesome Lists containing this project

README

        

## Install specific R version in Ubuntu

### Install R in your preferred version:

```
sudo bash bionic/install-r.sh
```

### Set additional default repositories

```
export REPO=
sudo bash set-repo.sh
```

### Install R package

```
sudo bash install-pkg.sh
```

### Install all R packages from repo

```
export REPO=
sudo bash install-repo.sh
```

### Uninstall all R packages from repo

```
export REPO=
sudo bash uninstall-repo.sh
```

## Example

To install R in version 3.5.1 and 3.5.2 on one system, you can run:

```
sudo bash bionic/install-r.sh 3.5.1 2018-08-31
sudo bash bionic/install-r.sh 3.5.2 2019-03-10
# set repository
export REPO=
sudo bash set-repo.sh 3.5.1
sudo bash set-repo.sh 3.5.2
# install packages
sudo bash install-pkg.sh 3.5.1 tidyverse
sudo bash install-pkg.sh 3.5.2 tidyverse
# install repositories
sudo bash install-repo.sh 3.5.1
sudo bash install-repo.sh 3.5.2
```

Now you have a 'base' stack of R packages for all your users installed. The
command `R` is bound to the latest version you installed. A specific version can
be launched using:

```
R -e 'sessionInfo()'
R-3.5.1 -e 'sessionInfo()'
R-3.5.2 -e 'sessionInfo()'
```

## Gotchas

`bionic/install-r.sh` assumes that the local installation of apt has the source
repositories for r-base activated. If this is not the case, e.g. in a fresh
installation of a server ubuntu, you may add the following lines to the
configuration:

```
sudo su -c "echo 'deb-src http://de.archive.ubuntu.com/ubuntu/ bionic universe
deb-src http://de.archive.ubuntu.com/ubuntu/ bionic-updates universe' > /etc/apt/sources.list.d/r-sources.list"
sudo apt update
```

and remove it with

```
sudo rm /etc/apt/sources.list.d/r-sources.list
sudo apt clean
sudo apt update
```