Description Usage Arguments Value Examples
View source: R/quick_save_plot.R
Convenience function to quickly save a plot to an image file and immediately inspect it. Based on the function 'ggpreview' by Tristan (TJ) Mahr.
1 2 3 4 5 6 7 8 9 |
plot |
A plot object. If unspecified, uses the most recent printed plot. |
fname |
A filename for the plot to be saved. Uses a temporary file in the user's temporary folder if unspecified. |
inspect |
A logical defaulting to 'TRUE' indicating whether to immediately open the file for inspection. |
device |
Device to use. Can either be a device function (e.g. png()), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only). Defaults to 'png'. |
dpi |
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types. |
scale |
Multiplicative scaling factor. |
... |
Additional arguments passed on to the 'ggsave' function. |
Saves a plot to a temporary file in the user's temp directory
1 2 | ggplot(mtcars, aes(mpg, wt)) + geom_point()
quick_save_plot()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.