Description Usage Arguments Examples
Run a code as a string in a docker image
1 | docker_run_code(code, docker_image, volumes = NULL, ...)
|
code |
An expression or string of R code |
docker_image |
A docker image name |
volumes |
Volume mapping from host to container |
... |
Parameters passed on to stevedore client creation and container running functions |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
# With string
docker_run_code("a = 1 + 1", "ismailsunni/gnur-3.6.1-debian-geospatial")
# With expression
docker_run_code(expression(1 + 1), "ismailsunni/gnur-3.6.1-debian-geospatial")
docker_run_code(expression(a = 1 + 1), "ismailsunni/gnur-3.6.1-debian-geospatial")
docker_run_code(expression(install.packages("ctv")), "ismailsunni/gnur-3.6.1-debian-geospatial")
# With multiple string
docker_run_code(c("a = 1 + 1", "b = a + 2", "print(b)"), "ismailsunni/gnur-3.6.1-debian-geospatial")
code = c("install.packages('ctv')", "library('ctv')", "available.views()")
docker_run_code(code, "ismailsunni/gnur-3.6.1-debian-geospatial")
# With multiple expressions
# This one is not working, see https://github.com/ismailsunni/altRnative/issues/1
# docker_run_code(c(expression(a = 1 + 1, b = a + 2)),
# "ismailsunni/gnur-3.6.1-debian-geospatial")
# This one is working
code = expression(install.packages("ctv"), library("ctv"), available.views())
docker_run_code(code, "ismailsunni/gnur-3.6.1-debian-geospatial")
# This code below is for running sample, need to set proper directory
code = expression(setwd('/home/docker/sdsr'),
bookdown::render_book('index.Rmd', 'bookdown::gitbook'))
docker_run_code(code, "ismailsunni/gnur-3.6.1-debian-geospatial",
volumes = '/home/ismailsunni/dev/r/sdsr:/home/docker/sdsr')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.