as.pdf.default: Convert to PDF by Default

Description Usage Arguments Value See Also Examples

View source: R/default.R

Description

Converts object to PDF. By default, device is scaled by plot size. Device is automatically closed and file argument is returned.

Usage

1
2
3
4
5
6
## Default S3 method:
as.pdf(x, width = getOption("plotscale_pdf_width", 3),
  height = getOption("plotscale_pdf_height", 3), devsize = if (scaled)
  "devsize" else "unscaled", scaled = getOption("plotscale_scaled", TRUE),
  onefile = TRUE, file = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf",
  ...)

Arguments

x

object

width

desired plot width

height

desired plot height

devsize

a function of x, width, height, and ... that calculates device size

scaled

whether to rescale width and height by plot size

onefile

logical: passed to pdf. If true (the default) allow multiple figures in one file. If false, generate a file with name containing the page number for each page. Defaults to TRUE, and forced to true if file is a pipe.

file

file name passed to pdf

...

other arguments to pdf and fun

Value

(invisible) the file argument

See Also

Other as.pdf: as.pdf

Other devices: as.pdf, as.png.default, as.png

Examples

1
2
3
4
options(example.ask = FALSE)
options(device.ask.default = FALSE)
library(lattice)
as.pdf(xyplot(2~3),file = tempfile())

plotscale documentation built on May 2, 2019, 6:50 a.m.