You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-41Lines changed: 12 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,29 @@ Generate a Git repository that can run R code with RStudio on
6
6
the browser via [mybinder.org](https://mybinder.org) or any JupyterHub
7
7
from this template repository!
8
8
9
-
Based on the [rocker/geospatial](https://hub.docker.com/r/rocker/geospatial)
10
-
image.
11
-
12
9
## How to use this repo
13
10
14
-
### 1. Create a new repo using this as a template
11
+
### 1. Add a Dockerfile to your repo with contents like so:
12
+
13
+
```
14
+
FROM rocker/binder
15
15
16
-
Use the [Use this template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template)
17
-
button on GitHub. Use a descriptive name representing the
18
-
GUI app you are running / demoing. You can then follow the rest of
19
-
the instructions in this README from your newly created repository.
16
+
COPY install.r install.r
17
+
RUN Rscript install.r
18
+
```
20
19
21
20
### 2. Install any packages you want
22
21
23
-
You can create an `install.R` file that will be executed on build.
24
-
Use `install.packages` or `devtools::install_version`.
22
+
You can create an `install.r` file that will be executed on build.
23
+
Use `install.packages()` to install:
25
24
26
25
```R
27
26
install.packages("ggplot2")
28
27
```
29
28
30
-
Packages are installed from [packagemanager.rstudio.com](https://packagemanager.rstudio.com/client/#/),
31
-
and binary packages are preferred wherever possible. For some R packages,
32
-
you might need to install system packages via apt - you can do so by writing
33
-
out a list of apt package names in `apt.txt`.
29
+
Binary versions of packages will be quickly installed from [r2u](https://github.com/eddelbuettel/r2u) via [bspm](https://cloud.r-project.org/web/packages/bspm/index.html). _There is no need to manually manage 'system' dependencies with apt-get, these are handled automatically in the Docker build phase_.
30
+
31
+
Commonly used packages in the `tidyverse` and `geospatial` collection are already installed, see [`install.r`](install.r)
34
32
35
33
### 3. Modify the Binder Badge in the README.md
36
34
@@ -39,30 +37,3 @@ You should modify it to point to your own repository. Keep the `urlpath=rstudio`
39
37
parameter intact - that is what makes sure your repo will launch directly into
40
38
RStudio
41
39
42
-
### 4. Add your R code and update README
43
-
44
-
Finally, add the R code you want to demo to the repository! Cleanup the README
45
-
too so it talks about your code, not these instructions on setting up this repo
46
-
47
-
## Troubleshooting
48
-
49
-
**It didn't work! What do I do now?**. If you are installing additional R
50
-
*packages, this will sometimes fail when a package requires an external library
51
-
*that is not found on the container. We're working on a more elegant solution
52
-
*for this case, but meanwhile, you'll need to modify the Dockerfile to install
53
-
*these libraries. For instance, the `gsl`[R package page
0 commit comments