Built as a wrapper around ggsave, this function facilitates the export of xpose plots.
Arguments
- plot
A xpose plot object.
- file
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 = '@[email protected]'.- dir
Directory under which the xpose plots will be saved. Template variables such as
@dircan be used to generate template names.- device
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).- scale
Multiplicative scaling factor.
- width, height, units
Plot size in in
units("in", "cm", "mm", or "px"). If not supplied, uses the size of current graphics device.- dpi
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.
- limitsize
When
TRUE(the default),xpose_save()will not save images larger than 50x50 inches, to prevent the common error of specifying dimensions in pixels.- bg
Background color. If
NULL, uses theplot.backgroundfill value from the plot theme.- ...
Other arguments passed on to the graphics device function, as specified by
device.
Examples
if (FALSE) { # \dontrun{
xpdb_ex_pk %>%
dv_vs_ipred() %>%
xpose_save(file = file.path(tempdir(), "dv_vs_ipred_example.pdf"))
} # }
