devOptions
From R.utils v1.12.0
by Henrik Bengtsson
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.
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 devicefunction
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
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.
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)
Community examples
Looks like there are no examples yet.