Containerize R Markdown documents. This function generates
Dockerfile
based on the liftr metadata in the RMD document.
lift(input = NULL, use_config = FALSE, config_file = "_liftr.yml", output_dir = NULL)
input | Input (R Markdown) file. |
---|---|
use_config | If |
config_file | Name of the YAML configuration file, under the
same directory as the input file. Default is |
output_dir | Directory to output |
Dockerfile
.
After running lift, run render_docker on the document to
render the containerized R Markdown document using Docker containers.
See vignette('liftr-intro')
for details about the extended
YAML front-matter metadata format used by liftr.
# 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 render_docker(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")) # }