R.utils (version 1.12.1)

devOptions: Gets the default device options

Description

Gets the default device options as given by predefined devices options adjusted for the default arguments of the device function.

Usage

devOptions(type=c("bmp", "cairo_pdf", "cairo_ps", "eps", "jpeg", "jpeg2", "pdf", "pictex", "png", "png2", "postscript", "quartz", "svg", "tiff", "windows", "x11", "xfig"), custom=TRUE, special=TRUE, ..., reset=FALSE)

Arguments

type
A character string or a device function specifying the device to be queried.
custom
If TRUE, also the default settings specific to this function is returned. For more details, see below.
special
A logical. For more details, see below.
...
Optional named arguments for setting new defaults. For more details, see below.
reset
If TRUE, the device options are reset to R defaults.

Value

  • Returns a named list. If the requested device does not exists (certain devices are OS specific), then an empty list is returned.

Setting new defaults

When setting device options, the getOption("devOptions")[[type]] option is modified. This means that for such options to be effective, any device function needs to query also such options, which for instance is done by devNew(). Also, for certain devices (eps, pdf, postscript, quartz, windows and x11), builtin R device options are set.

Details

If argument special is TRUE, then the 'width' and 'height' options are adjusted according to the rules explained for argument 'paper' in pdf, postscript, and xfig.

Examples

# Tabulate some of the default settings for known devices
knownDevices <- eval(formals(devOptions)$type)
fields <- c("width", "height", "bg", "fg", "pointsize")
opts <- sapply(knownDevices, FUN=function(type) {
  devOptions(type)[fields]
})
rownames(opts) <- fields
opts <- t(opts)
print(opts)