toPdf | R Documentation |
The function opens a PDF device with pdf
, executes the given
expressions, closes the PDF file and displays the file in a PDF viewer.
toPdf(expressions, pdfFile = NULL, ...)
expressions |
R expressions creating plots that are to be redirected into a pdf file. You may pass multiple expressions within opening and closing curly braces |
pdfFile |
optional. Path to the PDF file to be created. The directory
part of the path must exist. If not given or |
... |
further arguments passed to |
The function returns the path to the created PDF file.
## Not run:
toPdf({
plot(1:10, 10:1)
barplot(1:10)
hist(rnorm(100))
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.