Package liftr. R topics documented: May 14, Type Package

Similar documents
Package canvasxpress

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package fastdummies. January 8, 2018

Package validara. October 19, 2017

Package spelling. December 18, 2017

Package ECctmc. May 1, 2018

Package SEMrushR. November 3, 2018

Package calpassapi. August 25, 2018

Package docxtools. July 6, 2018

Package datapasta. January 24, 2018

Package slickr. March 6, 2018

Package jstree. October 24, 2017

Package datasets.load

Package robotstxt. November 12, 2017

Package bisect. April 16, 2018

Package shinyhelper. June 21, 2018

Package ezknitr. September 16, 2016

Package messaging. May 27, 2018

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package clipr. June 23, 2018

Package editdata. October 7, 2017

Package goodpractice

Package rsppfp. November 20, 2018

Package fastqcr. April 11, 2017

Package styler. December 11, Title Non-Invasive Pretty Printing of R Code Version 1.0.0

Package semver. January 6, 2017

Package githubinstall

Package knitrbootstrap

Package WordR. September 7, 2017

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package profvis. R topics documented:

Package workflowr. July 6, 2018

Package qualmap. R topics documented: September 12, Type Package

Package pdfsearch. July 10, 2018

Package knitrprogressbar

Package postgistools

Package facerec. May 14, 2018

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package essurvey. August 23, 2018

Package RODBCext. July 31, 2017

Package gtrendsr. October 19, 2017

Package radix. September 17, 2018

Package barcoder. October 26, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package dkanr. July 12, 2018

Package modules. July 22, 2017

Package cloudml. June 12, 2018

Package blogdown. April 19, 2018

Package vdiffr. April 27, 2018

Package vinereg. August 10, 2018

Package snakecase. R topics documented: March 25, Version Date Title Convert Strings into any Case

Package opencage. January 16, 2018

Package gtrendsr. August 4, 2018

Package fitbitscraper

Package rcmdcheck. R topics documented: November 10, 2018

Package data.world. April 5, 2018

Package htmlwidgets. February 25, 2016

Package tensorflow. January 17, 2018

Package texpreview. August 15, 2018

Package zoomgrid. January 3, 2019

Package tidytransit. March 4, 2019

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package BioInstaller

Package Numero. November 24, 2018

Package shinyfeedback

Package wdman. January 23, 2017

Package kirby21.base

Package eply. April 6, 2018

Package tabulizer. June 7, 2018

Package rzeit2. January 7, 2019

Package gridgraphics

Package internetarchive

Package repec. August 31, 2018

Package tfruns. February 18, 2018

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package censusapi. August 19, 2018

Package testit. R topics documented: June 14, 2018

Package tm.plugin.lexisnexis

Package pkgload. July 8, 2018

Package statsdk. September 30, 2017

Package BiocManager. November 13, 2018

Package BiocStyle. January 26, 2018

Package loggit. April 9, 2018

Package TrafficBDE. March 1, 2018

Package readxl. April 18, 2017

Package SASmarkdown. R topics documented: November 30, Version Date Title 'SAS' Markdown

Package censusr. R topics documented: June 14, Type Package Title Collect Data from the Census API Version 0.0.

Package rwars. January 14, 2017

Package simplecache. August 22, 2017

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package dotcall64. January 11, 2018

Package htmlwidgets. July 10, 2017

Package deductive. June 2, 2017

Package farver. November 20, 2018

Package stapler. November 27, 2017

Package googlecomputeenginer

Package spark. July 21, 2017

Package lumberjack. R topics documented: July 20, 2018

Transcription:

Type Package Package liftr May 14, 2018 Title Containerize R Markdown Documents for Continuous Reproducibility Version 0.9 Maintainer Nan Xiao <me@nanx.me> Persistent reproducible reporting by containerization of R Markdown documents. License GPL-3 file LICENSE SystemRequirements Docker (see <https://docs.docker.com/engine/installation/>) VignetteBuilder knitr URL https://nanx.me/liftr/, https://github.com/road2stat/liftr BugReports https://github.com/road2stat/liftr/issues Depends R (>= 3.0.2) Imports yaml, knitr, rmarkdown, stringr, rstudioapi Encoding UTF-8 RoxygenNote 6.0.1.9000 NeedsCompilation no Author Nan Xiao [aut, cre] (<https://orcid.org/0000-0002-0250-5673>), Miao-Zhu Li [ctb], Teng-Fei Yin [ctb] Repository CRAN Date/Publication 2018-05-14 06:02:48 UTC R topics documented: liftr-package......................................... 2 check_docker_install.................................... 2 check_docker_running................................... 3 install_docker........................................ 3 lift.............................................. 4 1

2 check_docker_install prune_all_auto....................................... 5 prune_container....................................... 6 prune_container_auto.................................... 6 prune_image........................................ 7 prune_image_auto...................................... 8 render_docker........................................ 8 Index 11 liftr-package Containerize R Markdown Documents for Continuous Reproducibility Details Persistent reproducible reporting by containerization of R Markdown documents. Package: Type: License: liftr Package GPL-3 Author(s) Nan Xiao <<me@nanx.me>> Miao-Zhu Li <<miaozhu.li@duke.edu>> Teng-Fei Yin <<tengfei.yin@sevenbridges.com>> check_docker_install Check if Docker was Installed This function checks if Docker was properly installed and discoverable by R and liftr. If still not usable, please start Docker daemon check_docker_install() TRUE if Docker was deteted, FALSE otherwise.

check_docker_running 3 check_docker_install() check_docker_running Check if Docker Daemon is Running This function checks if the Docker daemon is running. check_docker_running() TRUE if Docker daemon is running, FALSE otherwise. check_docker_running() install_docker Installation Helper for Docker Engine This function guides you to install Docker (Engine). install_docker() References https://docs.docker.com/engine/installation/ install_docker()

4 lift lift Containerize R Markdown Documents 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) Arguments input use_config config_file output_dir Input (R Markdown) file. If TRUE, will parse the liftr metadata from a YAML file, if FALSE, will parse such information from the metadata section in the R Markdown file. Default is FALSE. Name of the YAML configuration file, under the same directory as the input file. Default is "_liftr.yml". Directory to output Dockerfile. If not provided, will be the same directory as input. Details 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. Dockerfile. # 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) # containerization input = paste0(dir_example, "liftr-minimal.rmd") lift(input) # render the document with Docker render_docker(input)

prune_all_auto 5 # view rendered document browseurl(paste0(dir_example, "liftr-minimal.html")) # purge the generated Docker image purge_image(paste0(dir_example, "liftr-minimal.docker.yml")) prune_all_auto Remove Docker Containers, Images, and Networks This function removes stopped containers, all networks not used by at least one container, all dangling images, and all build cache. prune_all_auto(volumes = FALSE) Arguments volumes Logical. Should we prune volumes? Default is FALSE. prune results References https://docs.docker.com/engine/admin/pruning/ prune_all_auto()

6 prune_container_auto prune_container Remove Specific Docker Containers This function stops and removes the Docker containers used for rendering the R Markdown document based on the output YAML file from the (possibly unsuccessful) rendering process. prune_container(input_yml) purge_container() Arguments input_yml The YAML file path (output of render_docker) when prune_info = TRUE which stores the information of the Docker container to be stopped and removed. If not specified, will prune all dangling containers. prune results prune_container() prune_container_auto Remove Dangling Docker Containers This function prunes all dangling Docker containers automatically. prune_container_auto() prune results

prune_image 7 References https://docs.docker.com/engine/admin/pruning/ prune_container_auto() prune_image Remove Specific Docker Images This function removes the Docker images used for rendering the R Markdown document based on the output YAML file from the (possibly unsuccessful) rendering process. prune_image(input_yml) purge_image() Arguments input_yml The YAML file path (output of render_docker) when prune_info = TRUE which stores the information of the Docker image to be removed. If not specified, will prune all dangling images. prune results prune_image()

8 render_docker prune_image_auto Remove Dangling Docker Images This function prunes all dangling Docker images automatically. prune_image_auto() prune results References https://docs.docker.com/engine/admin/pruning/ prune_image_auto() render_docker Render Containerized R Markdown Documents Render R Markdown documents using Docker. render_docker(input = NULL, tag = NULL, container_name = NULL, cache = TRUE, build_args = NULL, run_args = NULL, prune = TRUE, prune_info = TRUE, dry_run = FALSE,...) drender(...)

render_docker 9 Arguments input tag Details Input file to render in Docker container. Docker image name to build, sent as docker argument -t. If not specified, it will use the same name as the input file. container_name Docker container name to run. If not specified, will use a randomly generated name. cache build_args run_args prune Logical. Controls the --no-cache argument in docker run. Setting this to be TRUE can accelerate the rendering speed substantially for repeated/interactive rendering since the Docker image layers will be cached, with only the changed (knitr related) image layer being updated. Default is TRUE. A character string specifying additional docker build arguments. For example, --pull=true -m="1024m" --memory-swap="-1". A character string specifying additional docker run arguments. For example, --privileged=true. Logical. Should we clean up all dangling containers, volumes, networks, and images in case the rendering was not successful? Default is TRUE. prune_info Logical. Should we save the Docker container and image information to a YAML file (name ended with.docker.yml) for manual pruning or inspections later? Default is TRUE. dry_run Preview the Docker commands but do not run them? Useful for debugging purposes. Default is FALSE.... Additional arguments passed to render. Before using this function, please run lift on the RMD document first to generate the Dockerfile. After a successful rendering, you will be able to clean up the Docker image with prune_image. Please see vignette('liftr-intro') for details of the extended YAML metadata format and system requirements for writing and rendering containerized R Markdown documents. A list containing the image name, container name, and Docker commands will be returned. An YAML file ending with.docker.yml storing the image name, container name, and Docker commands for rendering this document will be written to the directory of the input file. The rendered output will be written to the directory of the input file. # copy example file dir_example = paste0(tempdir(), "/liftr-tidyverse/") dir.create(dir_example) file.copy(system.file("examples/liftr-tidyverse.rmd", package = "liftr"), dir_example) # containerization

10 render_docker input = paste0(dir_example, "liftr-tidyverse.rmd") lift(input) # print the Docker commands first render_docker(input, dry_run = TRUE) # render the document with Docker render_docker(input) # view rendered document browseurl(paste0(dir_example, "liftr-tidyverse.pdf")) # remove the generated Docker image prune_image(paste0(dir_example, "liftr-tidyverse.docker.yml"))

Index check_docker_install, 2 check_docker_running, 3 drender (render_docker), 8 install_docker, 3 lift, 4, 4, 9 liftr-package, 2 prune_all_auto, 5 prune_container, 6 prune_container_auto, 6 prune_image, 7, 9 prune_image_auto, 8 purge_container (prune_container), 6 purge_image (prune_image), 7 render, 9 render_docker, 4, 6, 7, 8 11