device | R Documentation |
dev.off.pdf()
is a wrapper of dev.off()
which is
meant for closing a pdf device. It also performs
cropping and font embedding if chosen.
dev.off.pdf(file="Rplots.pdf", crop=NULL, embedFonts="", ...)
file |
output file name including extension .pdf. |
crop |
cropping command, can be one of:
|
embedFonts |
font embedding command, can be one of:
|
... |
additional arguments passed to |
invisible()
.
Marius Hofert
dev.off()
for closing a device,
embedFonts()
for font embedding.
sfsmisc's pdf.end()
for another approach.
## typical usage
doPDF <- !dev.interactive(orNone=TRUE)
if(doPDF) pdf(file=(file <- "crop_device.pdf"), width=6, height=6)
plot(1)
if(doPDF) dev.off.pdf(file)
if(file.exists(file)) file.remove(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.