exportgraphics: Open a graphics device

exportgraphicsR Documentation

Open a graphics device

Description

Starts the graphics device driver

Usage

exportgraphics(
  file,
  type = tail(strsplit(file, split = "\\.")[[1]], 1),
  export = fdm2id.globals$export,
  ...
)

Arguments

file

A character string giving the name of the file.

type

The type of graphics device. Deduced from the file extension by default: "eps" and "ps" go to postscript, "jpg" to jpeg, and any other extension is taken as the name of an R function ("pdf", "png", ...).

export

If given, explicitly overrides the global export toggle set by toggleexport for this call only. By default, the global toggle is used, so existing code is unaffected.

...

Other parameters.

See Also

closegraphics, toggleexport, Devices

Examples

## Not run: 
data (iris)
exportgraphics ("export.pdf")
plotdata (iris [, -5], iris [, 5])
closegraphics()
# Extensions that don't match an R function name directly are now handled:
exportgraphics ("export.eps")
plotdata (iris [, -5], iris [, 5])
closegraphics()

## End(Not run)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.