Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write_plot

Write out a ggplot2 graphic with minimal configuration


Description

Takes a ggplot2 object and writes it to disk via ggplot2::ggsave using the variable name as the filename.

Usage

write_plot(variable, format = "png", output_dir = dir_plots(), ...)

Arguments

variable

A tibble or dataframe object.

format

The desired format for the plot, be it 'png', 'pdf', etc. Accepts formats you'd pass to ggplot2::ggsave's 'device' parameter.

output_dir

The directory to save the plot out to.

...

Other settings to pass to ggsave, such as format, width, height or dpi.

Value

No return value, called for side effects


upstartr

Utilities Powering the Globe and Mail's Data Journalism Template

v0.1.1
MIT + file LICENSE
Authors
Tom Cardoso [aut, cre] (creator and maintainer), Michael Pereira [ctb], The Globe and Mail Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.