print_plots: print some plots to a pdf file

Description Usage Arguments Details

View source: R/fun-print_plots.R

Description

Gather multipel existing ggplot objects and print them to one file (one plot per page).

Usage

1
print_plots(file = "some_plots.pdf", pattern = "plot\\.[0-9]+", ...)

Arguments

file

file to print to

pattern

regular expression to locate plot objects by

...

arguments passed to other functions, specifically width and height to pdf

Details

This is a simple utility function. It finds all objects in the global environment whose names match a given regular expression and tries to send them to the pdf device. In an analysis where multiple plots are produced, this can help to export them into neat files, with some care for naming them.

NULL objects will be ignored


olobiolo/acutils documentation built on Nov. 28, 2021, 9:35 p.m.