dev.cur() dev.list() dev.next(which = dev.cur()) dev.prev(which = dev.cur()) dev.off(which = dev.cur()) dev.set(which = dev.next())
dev.list returns the number and name of all active devices.
dev.next returns the number and name of the graphics device next on the list of active graphics devices.
dev.prev return the number and name of the graphics device previous to the current device on the list of active graphics devices.
dev.set returns the number and name of the (newly) current graphics device. (This may not be the one you asked for if which does not refer to an active device.)
dev.off returns the number of the current device after device which was shutdown.
dev.off turns off the graphics device given by which.
motif() plot(x <- sort(rnorm(100))) motif() plot(y <- sort(rnorm(100))) dev.set(dev.prev()) abline(lsfit(1:100, x)) dev.set(dev.next()) abline(lsfit(1:100, y)) names(dev.list())