View source: R/export_ggplot.R
export_ggplot | R Documentation |
.pdf
file.Function to export ggplot2 plot, usually as a .pdf
file.
export_ggplot(
file = NA,
plot = ggplot2::last_plot(),
width = 6,
height = 5,
crop = FALSE,
to_png = FALSE,
png_resolution = 320,
device = NULL,
verbose = FALSE
)
file |
File name to export plot to, usually as a |
plot |
ggplot2 object. If not used, the last plot will be retrieved. |
width |
Plot width in inches. |
height |
Plot height in inches. |
crop |
Should the output be cropped? systemr needs to be
installed if |
to_png |
Should the file be converted to a |
png_resolution |
If |
device |
Device to use. Use |
verbose |
Should the function give messages? |
Invisible ggplot2 object.
Stuart K. Grange
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.