preparePdf | R Documentation |
Opens a PDF device in A4 paper format. After calling this function all plots
go into the specified PDF file in pdfFile
. Important: The PDF file
needs to be closed explicitely with grDevices::dev.off() after all desired
plots have been made.
preparePdf(
pdfFile = tempfile(fileext = ".pdf"),
landscape = TRUE,
borderWidth.cm = 2,
borderHeight.cm = 2,
width.cm = NULL,
height.cm = NULL,
makeCurrent = TRUE,
paper = NULL,
...
)
pdfFile |
Full path to PDF file to be created |
landscape |
If |
borderWidth.cm |
(Total) border width in "width" direction in cm |
borderHeight.cm |
(Total) border width in "height" direction in cm |
width.cm |
page width in cm. Default according to DIN A4 |
height.cm |
page height in cm. Default according to DIN A4 |
makeCurrent |
if |
paper |
passed to |
... |
further arguments passed to |
full path to pdf file
finishAndShowPdf
## Not run:
# Open PDF file by giving a path to preparePdf(). The path is returned.
pdf_file <- preparePdf(file.path(tempdir(), "example_preparePdf.pdf"))
# Plot something
plot(x <- seq(-pi,pi,pi/100), sin(x), type = "l")
# Open PDF file in viewer
finishAndShowPdf(pdf_file)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.