openDevice {Smisc} | R Documentation |
Based on the filename extension, will open plotting device using one of the
following graphics functions:
postscript
, pdf
, jpeg
,
tiff
, png
, or bmp
.
openDevice(fileName, ...)
fileName |
Character string giving the filename for the graphics
output. The following are acceptable filename extensions:
|
... |
Named arguments to the device functions listed above. Arguments that do not match are silently ignored. |
The graphics device is opened and the filename is invisibly returned.
Landon Sego
# Open 3 example devices openDevice("ex1.pdf", height=6, width=12) plot(1:10, 1:10) openDevice("ex1.jpg") plot(1:10, 1:10) openDevice("ex1.png") plot(1:10, 1:10) # List the devices and their filenames dev.list() dir(pattern = "ex1") # Turn each of the 3 devices off for (i in 1:3) { dev.off(dev.list()[length(dev.list())]) } # Delete the created files unlink(c("ex1.pdf","ex1.png","ex1.jpg")) # List the current devices dev.list()