output_plots | R Documentation |
This function outputs plots with a specified format, while allowing checks for whether to overwrite
an existing file. It is basically a wrapper on pdf
, png
, and plotscale::as.pdf
.
output_plots(
x,
fileDir = "plots",
fileStem,
plotFormat = c("plotscalePdf", "pdf", "png"),
width,
height,
pngRes = 150,
overwrite = FALSE
)
outputPlots(
x,
fileDir = "plots",
fileStem,
plotFormat = c("plotscalePdf", "pdf", "png"),
width,
height,
pngRes = 150,
overwrite = FALSE
)
x |
plot object |
fileDir |
directory to save the file. Defaults to "plots", which outputs to a subfolder in the working directory. If the specified directory does not exist, the function will create it. |
fileStem |
the stem of the file name, without the extension |
plotFormat |
character vector of plot formats to output. Can be any combination of "plotscalePdf", "pdf", and "png". |
width |
width of the plot or graphics output in inches; for plotscalePdf, this is the width of the plot area, not the graphics output area |
height |
height of the plot or graphics output; for plotscalePdf, this is the width of the plot area, not the graphics output area |
pngRes |
resolution of the PNG file in dpi. Ignored if "png" is not in |
overwrite |
logical indicating whether to overwrite an existing file. Defaults to |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.