export_pngs: Export a plot list as PNGs

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Takes a list of plot objects and builds a folder with those plots as individual png files

Usage

1
2
export_pngs(plot_list, dir_path, overwrite = TRUE, height = 8.5,
  width = 11, units = "in")

Arguments

plot_list

List containing plot objects

dir_path

Path for output directory that will be created

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.

height

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

width

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

units

Character object, for unit used in height and width, "in" (inches by default). Can be "px", "mm", or "cm".

Value

A directory with the elements of plot_list as png files

Examples

1
2
3
4
5
6
7
## Not run: 
plots <- mtcars %>% split(.$cyl) %>%
           purrr::map(~ ggplot(., aes(mpg, disp)) +
                          geom_point())
export_pngs(plots, "~/Desktop/mtcars_plots_by_cyl.pdf")

## End(Not run)

hemoshear/assayr2 documentation built on Nov. 8, 2019, 6:13 p.m.