toPdf: Let Expressions Plot into a PDF File

View source: R/pdf.R

toPdfR Documentation

Let Expressions Plot into a PDF File

Description

The function opens a PDF device with pdf, executes the given expressions, closes the PDF file and displays the file in a PDF viewer.

Usage

toPdf(expressions, pdfFile = NULL, ...)

Arguments

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 NULL, the PDF file is created in the tempdir() folder.

...

further arguments passed to pdf

Value

The function returns the path to the created PDF file.

Examples

## Not run: 
toPdf({
  plot(1:10, 10:1)
  barplot(1:10)
  hist(rnorm(100))
})

## End(Not run)

KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.