Description Usage Arguments Value Author(s) Examples
Based on the filename extension, will open plotting device using one of the
following graphics functions:
postscript
, pdf
, jpeg
,
tiff
, png
, or bmp
.
1 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.