ggSave | R Documentation |
This function is vectorized over all argument except 'plot': so if you
want to save multiple versions, simply provide vectors. Vectors of length
1 will be recycled using rep()
; otherwise vectors have to all be the same
length as file
.
ggSave(
file = NULL,
plot = ggplot2::last_plot(),
width = ufs::opts$get("ggSaveFigWidth"),
height = ufs::opts$get("ggSaveFigHeight"),
units = ufs::opts$get("ggSaveUnits"),
dpi = ufs::opts$get("ggSaveDPI"),
device = NULL,
type = NULL,
bg = "transparent",
preventType = ufs::opts$get("ggSavePreventType"),
...
)
file |
The file where to save to. |
plot |
The plot to save; if omitted, the last drawn plot is saved. |
height , width |
The dimensions of the plot, specified in |
units |
The units, |
dpi |
The resolution (dots per inch). This argument is vectorized. |
device |
The graphic device; is inferred from the file if not specified. |
type |
An additional arguments for the graphic device. |
bg |
The background (e.g. 'white'). |
preventType |
Whether to prevent passing a value for the |
... |
Any additional arguments are passed on to |
The plot, invisibly.
plot <- ufs::ggBoxplot(mtcars, 'mpg');
ggSave(file=tempfile(fileext=".png"), plot=plot);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.