@@ -6,7 +6,7 @@ knitr::opts_chunk$set(echo = TRUE, collapse = TRUE, eval = FALSE)
6
6
```
7
7
8
8
In the context of productive solutions, it is essential to have full control
9
- over the code-base and environment to ensure reproducibility and stability of
9
+ over the codebase and environment to ensure reproducibility and stability of
10
10
the setup. In the case of R-based projects, this implies fixing and aligning the
11
11
version of R as well as package and system dependencies. In order to achieve
12
12
well-managed release pipelines, a key aspect is to guarantee full equivalence of
@@ -53,7 +53,7 @@ for an example.
53
53
When developing and testing an app locally, it is important to ensure the
54
54
environment is aligned with the target deployment environment. This might imply
55
55
using e.g. multiple R and package versions for the local development of
56
- different applications, which clash with the typical setup (especially on
56
+ different applications. This is not possible with the typical setup (especially on
57
57
Linux systems), where only one R version (the latest release) exists.
58
58
59
59
The idea is then to rely on the same version-stable rocker containers used for
@@ -64,9 +64,9 @@ use e.g. `rocker/rstudio:4.4.1`.
64
64
65
65
Note that the same version-stable instance of RStudio can be used across all
66
66
different projects for which such version is relevant. For this reason, a
67
- sensible choice is to rely on ` rocker/verse ` , which adds tidyverse and
68
- devtools to the stack, as well as properly setting up R Markdown system
69
- dependencies TinyTeX and ` pandoc ` , sparing the effort of the tedious extra
67
+ sensible choice is to rely on ` rocker/verse ` images , which add tidyverse and
68
+ devtools to the stack. They also include R Markdown system
69
+ dependencies TinyTeX and pandoc, sparing the effort of the tedious extra
70
70
install. See the specific section below about 'TinyTeX considerations'.
71
71
72
72
@@ -89,7 +89,7 @@ following setup:
89
89
- Use a version-specific port, e.g. ` 4000 ` for R 4.0.0, ` 4410 ` for R 4.4.1 and
90
90
so on, so that we can use ` localhost ` for concurrent R version instances.
91
91
- The development code of all relevant projects should live outside the
92
- container and be shared with it (and possibly many of them ), e.g. under
92
+ container and be shared with it (and possibly multiple other containers ), e.g. under
93
93
` ~/RStudioProjects ` on the host machine and ` /home/rstudio/RStudioProjects ` in
94
94
the container.
95
95
- For this to work w/o [ permission
@@ -100,10 +100,10 @@ the container.
100
100
` ~/.rstudio-docker/4.4.1 ` ) for the ` home/rstudio/.rstudio ` directory, which is
101
101
version-specific in case of multiple R versions
102
102
- If we want to use Meld via the [ compareWith] ( https://github.com/miraisolutions/compareWith/ ) addins, we need to
103
- - map the ` DISPLAY ` environment variable and volume ` /tmp/.X11-unix `
104
- - add ` DISPLAY ` to ` Renviron `
105
- - install Meld
106
- - install ` dbus-x11 `
103
+ - map the ` DISPLAY ` environment variable and volume ` /tmp/.X11-unix ` ,
104
+ - add ` DISPLAY ` to ` Renviron ` ,
105
+ - install Meld,
106
+ - install ` dbus-x11 ` .
107
107
- Use a version-specific name for the container running the RStudio instance,
108
108
e.g. ` rstudio_4.4.1 ` .
109
109
@@ -132,7 +132,7 @@ docker exec rstudio_$R_VER bash -c \
132
132
```
133
133
If you are using R_VER=4.4.1, the running RStudio can then be accessed by visiting ` http://localhost:4410/ ` .
134
134
135
- You may find convenient to define a shell function as follows
135
+ You may find convenient to define a shell function for these steps:
136
136
137
137
``` {bash run_rstudio_ver-def}
138
138
run_rstudio_ver() {
@@ -169,7 +169,7 @@ run_rstudio_ver() {
169
169
}
170
170
```
171
171
172
- which you can re-use as compact command for any R version as follows
172
+ which you can re-use as compact command for any R version:
173
173
``` {bash run_rstudio_ver-use}
174
174
run_rstudio_ver 4.4.1 RStudioProjects
175
175
```
@@ -200,7 +200,7 @@ This is why we use a mounted volume for the `~/.rstudio` directory.
200
200
Older ` rocker/verse ` images might not include ` pdfcrop ` , which is required for
201
201
the default and desirable cropping of PDF figures with R Markdown (see
202
202
[ rocker-org/rocker-versioned #146 ] ( https://github.com/rocker-org/rocker-versioned/issues/146 ) ).
203
- Make sure ` pdfcrop ` is installed by running at R console
203
+ Make sure ` pdfcrop ` is installed by running the following in the R console:
204
204
``` {r pdfcrop}
205
205
tinytex::tlmgr_install("pdfcrop")
206
206
```
0 commit comments