devOptions

0th

Percentile

Gets the default device options

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

Keywords
utilities, device
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.
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.

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.

Aliases
  • devOptions
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)
Documentation reproduced from package R.utils, version 1.12.0, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.