Render dockerized R Markdown documents using Docker containers.
drender(input = NULL, tag = NULL, build_args = NULL, container_name = NULL, no_cache = TRUE, output_yaml = TRUE, ...)
input | Input file to render in Docker container. |
---|---|
tag | Docker image name to build, sent as docker argument |
build_args | A character string specifying additional
|
container_name | Docker container name to run. If not specified, will use a randomly generated name. |
no_cache | Logical. Controls the |
... | Additional arguments passed to
|
purge_info | Logical. Should we write the Docker container and
image information to a YAML file for purging later?
Default is |
Rendered file is written to the same directory of the input file.
A character vector with the image name and container name will be
returned. You will be able to manage them with docker
commands later or with the cleanup functions.
Before using drender()
, run lift on the RMD document
first to generate the Dockerfile
.
See vignette('liftr-intro')
for details about the extended
YAML front-matter metadata format and system requirements for
rendering dockerized R Markdown documents.
# copy example file dir_example = paste0(tempdir(), '/liftr-minimal/') dir.create(dir_example) file.copy(system.file("examples/liftr-minimal.Rmd", package = "liftr"), dir_example)#> [1] TRUE# containerization input = paste0(dir_example, "liftr-minimal.Rmd") lift(input) ## Not run: ------------------------------------ # # render the document with Docker # drender(input) # # # view rendered document # browseURL(paste0(dir_example, "liftr-minimal.html")) # # # purge the generated Docker image # purge_image(paste0(dir_example, "liftr-minimal.docker.yml")) ## ---------------------------------------------