Last data update: 2014.03.03

R: Dockerize R Markdown Documents
liftR Documentation

Dockerize R Markdown Documents

Description

Generate Dockerfile for R Markdown documents. Rabix is supported if there is certain metadata in the R Markdown document: the function will generate a Rabixfile containing the parsed running parameters under the output directory.

Usage

lift(input = NULL, output_dir = NULL)

Arguments

input

Input (R Markdown) file.

output_dir

Directory to output Dockerfile. If not provided, will be the same directory as input.

Details

After running lift, run drender on the document to render the Dockerized R Markdown document using Docker containers. See vignette('liftr-intro') for details about the extended YAML front-matter metadata format used by liftr.

Value

Dockerfile (and Rabixfile if possible).

Examples

# 1. Dockerized R Markdown document
dir_docker = paste0(tempdir(), '/lift_docker/')
dir.create(dir_docker)
file.copy(system.file("docker.Rmd", package = "liftr"), dir_docker)
# use lift() to parse Rmd and generate Dockerfile
lift(paste0(dir_docker, "docker.Rmd"))
# view generated Dockerfile
readLines(paste0(dir_docker, "Dockerfile"))

# 2. Dockerized R Markdown document with Rabix options
dir_rabix = paste0(tempdir(), '/lift_rabix/')
dir.create(dir_rabix)
file.copy(system.file("rabix.Rmd", package = "liftr"), dir_rabix)
lift(input = paste0(dir_rabix, "rabix.Rmd"))
# view generated Dockerfile
readLines(paste0(dir_rabix, "Dockerfile"))
# view generated Rabixfile
readLines(paste0(dir_rabix, "Rabixfile"))

Results