| cyt_export | R Documentation |
The purpose of this helper is to save a collection of plots
generated throughout the CytoProfile package to a user specified
format. It is designed to handle objects created with ggplot2
(or other grid based plots), recorded base plots (see
grDevices::recordPlot()), or custom drawing functions stored
as closures. If a multi-page PDF is requested, all plots are
written into a single file; for raster formats (PNG, JPEG and
TIFF), each element of the plot list is saved to its own file
with a numbered suffix. Nothing is returned except invisibly.
cyt_export(
plots,
filename = "cyto_output",
format = c("pdf", "png", "jpeg", "tiff", "svg"),
width = 7,
height = 5,
dpi = 300,
which = NULL
)
plots |
A single plot object or a list of plots. Each
element may be a |
filename |
Base file name (without extension). The
appropriate extension is added automatically depending on
|
format |
Character string giving the desired output format. One of "pdf", "png", "jpeg" or "tiff". Partial matching is performed. The default is "pdf". |
width, height |
Width and height of the device in inches. These arguments are passed directly to the graphics device. |
dpi |
Resolution in dots per inch used for raster formats (ignored for PDF). |
which |
Optional character vector naming the subset of
|
# Example usage within CytoProfile:
# res <- cyt_splsda(...)
# cyt_export(res$plots, filename = "splsda", format = "png")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.