fig_save: Save a ggplot to multiple formats

Description Usage Arguments Examples

Description

This function saves a ggplot object to multiple formats in the same dimensions with similar filenames. By default it saves to SVG, PDF, and PNG.

Usage

1
2
fig_save(plot, filename = "plot", formats = c("svg", "pdf", "png"),
  width = 11, height = 8.5)

Arguments

plot

The ggplot object to save

filename

The file name without the extension

formats

A character vector of formats to save

width

The width in the same units that ggsave uses.

height

The height in the same units that ggsave uses.

Examples

1
2
3
require(ggplot2)
plot <- qplot(mpg, wt, data = mtcars)
fig_save(plot)

lmullen/mullenMisc documentation built on May 21, 2019, 7:35 a.m.