outputPlotsAsPdfs: Export plots

Description Usage Arguments Value Examples

Description

Takes a list of plot objects and builds a pdf document with those plots.

Usage

1
2
outputPlotsAsPdfs(plot_list, pdf_path, overwrite = TRUE,
  session_info = TRUE, height = 8.5, width = 11)

Arguments

plot_list

List containing plot objects.

pdf_path

Path for output pdf that will be created. Should end in ".pdf".

overwrite

Logical indicating whether to overwrite an existing directory with the same path. Defaults to TRUE for easy analysis interation. Adjust to FALSE to add individual images to existing directory, may throw errors about existing files.

session_info

Logical whether to include a gtools::textplot with the output of sessionInfo(). Useful for reproducible research.

height

Numeric object describing height of graphics device. Default unit is inches.

width

Numeric object describing width of graphics device. Default unit is inches.

Value

A directory with the elements of plot_list as png files

Examples

1
2
3
4
plots <- mtcars %>% split(.$cyl) %>%
           purrr::map(~ ggplot(., aes(mpg, disp)) +
                          geom_point())
outputPlotsAsPngs(plots, "~/Desktop/mtcars_plots_by_cyl/")

stevehoang/assayr documentation built on May 24, 2019, 7:20 a.m.