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

devOptions(type=NULL, custom=TRUE, special=TRUE, inherits=FALSE, drop=TRUE,
  options=list(), ..., reset=FALSE)

Arguments

type

A character string or a device function specifying the device to be queried. May also be a vector, for querying device options for multiple devices.

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.

inherits

If TRUE, the global option is used if the type-specific is not set (or NULL).

drop

If TRUE and only one device type is queried, then a list is returned, otherwise a matrix.

options

Optional named list of settings.

...

Optional named arguments for setting new defaults. For more details, see below.

reset

If TRUE, the device options are reset to R defaults.

Value

If drop=TRUE and a single device is queries, a named list is returned, otherwise a matrix is returned. If a requested device is not implemented/supported on the current system, then "empty" results are returned. If options were set, that is, if named options were specified via

..., then the list is returned invisibly, otherwise not.

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.

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.

Author

Henrik Bengtsson

Examples

# Tabulate some of the default settings for known devices
print(devOptions()[,c("width", "height", "bg", "fg", "pointsize")])
#>            width height bg            fg      pointsize
#> *          NULL  NULL   NULL          NULL    NULL     
#> bmp        480   480    "white"       NULL    12       
#> cairo_pdf  7     7      "white"       NULL    12       
#> cairo_ps   7     7      "white"       NULL    12       
#> CairoPDF   6     6      "transparent" "black" 12       
#> CairoPNG   480   480    "white"       NULL    12       
#> CairoPS    8.5   11     "transparent" "black" 12       
#> CairoSVG   6     6      "transparent" NULL    12       
#> CairoX11   7     7      "transparent" NULL    12       
#> eps        7     7      "transparent" "black" 12       
#> favicon    32    ?      "transparent" NULL    12       
#> jpeg       480   480    "white"       NULL    12       
#> jpeg2      480   480    "transparent" "black" 12       
#> nulldev    480   480    "white"       ?       12       
#> pdf        7     7      "transparent" "black" 12       
#> pictex     5     4      "white"       "black" NULL     
#> png        480   480    "white"       NULL    12       
#> png2       480   480    "transparent" "black" 12       
#> postscript 8.5   11     "transparent" "black" 12       
#> quartz     7     7      "transparent" NULL    12       
#> svg        7     7      "white"       NULL    12       
#> tiff       480   480    "white"       NULL    12       
#> x11        NA    NA     "transparent" NULL    12       
#> X11        NA    NA     "transparent" NULL    12       
#> xfig       8.5   11     "transparent" "black" 12