https://github.com/vigenere23/R-docker-template
A minimal template for using R with renv inside a Docker image.
https://github.com/vigenere23/R-docker-template
docker docker-compose r renv
Last synced: 11 months ago
JSON representation
A minimal template for using R with renv inside a Docker image.
- Host: GitHub
- URL: https://github.com/vigenere23/R-docker-template
- Owner: vigenere23
- Archived: true
- Created: 2021-09-02T19:40:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T18:46:25.000Z (over 4 years ago)
- Last Synced: 2024-12-04T07:36:58.431Z (over 1 year ago)
- Topics: docker, docker-compose, r, renv
- Language: R
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - vigenere23/R-docker-template - A minimal template for using R with renv inside a Docker image. (R)
README
# R Docker template
A minimal template for using R with renv inside a Docker image.
## Description
This template uses the base Docker image [`vigenere23/renv-dev`](https://github.com/vigenere23/renv-docker) for using R with `renv`. It also sets up some sweat volumes for hot reloading and cache.
## Known problems
- Figures are outputed as pdf files instead of interactive windows
- Files created by the Docker image require root privileges, meaning you can't modifiy or remove them without "sudo-ing"
## Usage
### Enable X11
```shell
./scripts/init.sh
```
This will add remote control access on X11 for Docker. To remove access, simply run :
```shell
./scripts/uninit.sh
```
### Build image
This will build the R image and sets up volumes, install dependencies, and create `renv` related files.
```shell
docker-compose up --build
```
### Launch interactive R shell
```shell
docker-compose run r
```
### Launch a R script
```shell
docker-compose run r Rscript test.r
```
### Execute a R command
```shell
docker-compose run r Rscript -e 'renv:::renv_paths_cache()'
```