# NOT RUN {
## Unix-specific example
# Create multiple named devices
devs <- dev_create(line = X11(), points = x11())
# switch to device named "points"
devs$dev_which('points')
plot(1:10)
# switch to "line" device
devs$dev_switch('line')
plot(1:100, type='l')
# Create another group with conflict name
dev_another <- dev_create(line = X11())
# Query device name with 'line'
dev_another$dev_which('line') # 4
devs$dev_which('line') # 2, doesn't conflict with the new groups
dev.list()
# close one or more device
dev_another$dev_off('line')
dev.list()
# close all devices
devs$dev_off()
dev.list()
# }
Run the code above in your browser using DataLab