Built as a wrapper around ggsave, this function facilitates the export of xpose plots.
A xpose plot object.
A name with file extension (if device is NULL
) to be given
to the output file. Template variables such as @run
(run number) and
@plotfun
(plot function) can be used to automatically name files
e.g. file = '@run_@plotfun.pdf'
.
Directory under which the xpose plots will be saved. Template
variables such as @dir
can be used to generate template names.
Graphical device to use. Can be 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).
Multiplicative scaling factor.
Plot size in in units
("in", "cm", "mm", or
"px"). If not supplied, uses the size of current graphics device.
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.
When TRUE
(the default), xpose_save()
will not
save images larger than 50x50 inches, to prevent the common error of
specifying dimensions in pixels.
Background color. If NULL
, uses the plot.background
fill value from the plot theme.
Other arguments passed on to the graphics device function, as
specified by device
.
if (FALSE) {
xpdb_ex_pk %>%
dv_vs_ipred() %>%
xpose_save(file = file.path(tempdir(), "dv_vs_ipred_example.pdf"))
}