Learn R Programming

fdm2id (version 1.0.1)

exportgraphics: 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

Run this code
if (FALSE) {
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()
}

Run the code above in your browser using DataLab