lift.Rd 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/lift.R
  3. \name{lift}
  4. \alias{lift}
  5. \title{Containerize R Markdown Documents}
  6. \usage{
  7. lift(input = NULL, use_config = FALSE, config_file = "_liftr.yml",
  8. output_dir = NULL)
  9. }
  10. \arguments{
  11. \item{input}{Input (R Markdown) file.}
  12. \item{use_config}{If \code{TRUE}, will parse the liftr metadata from
  13. a YAML file, if \code{FALSE}, will parse such information from the
  14. metadata section in the R Markdown file. Default is \code{FALSE}.}
  15. \item{config_file}{Name of the YAML configuration file, under the
  16. same directory as the input file. Default is \code{"_liftr.yml"}.}
  17. \item{output_dir}{Directory to output \code{Dockerfile}.
  18. If not provided, will be the same directory as \code{input}.}
  19. }
  20. \value{
  21. \code{Dockerfile}.
  22. }
  23. \description{
  24. Containerize R Markdown documents. This function generates
  25. \code{Dockerfile} based on the liftr metadata in the RMD document.
  26. }
  27. \details{
  28. After running \link{lift}, run \link{render_docker} on the document to
  29. render the containerized R Markdown document using Docker containers.
  30. See \code{vignette('liftr-intro')} for details about the extended
  31. YAML front-matter metadata format used by liftr.
  32. }
  33. \examples{
  34. # copy example file
  35. dir_example = paste0(tempdir(), '/liftr-minimal/')
  36. dir.create(dir_example)
  37. file.copy(system.file("examples/liftr-minimal.Rmd", package = "liftr"), dir_example)
  38. # containerization
  39. input = paste0(dir_example, "liftr-minimal.Rmd")
  40. lift(input)
  41. \dontrun{
  42. # render the document with Docker
  43. render_docker(input)
  44. # view rendered document
  45. browseURL(paste0(dir_example, "liftr-minimal.html"))
  46. # purge the generated Docker image
  47. purge_image(paste0(dir_example, "liftr-minimal.docker.yml"))}
  48. }