Learn R Programming

playwith (version 0.9-11)

playDev: Work with the playwith device

Description

Part of the playwith Application Programming Interface.

Usage

playDevCur()
playDevList()
playDevSet(playState)
playDevOff(playState = playDevCur())

Arguments

playState
a playState object representing the plot, window and device.

Value

  • playDevCur returns the currently active playState object. playDevList returns a list of playState objects for all open playwith plot windows.

Details

These are analogous to dev.cur, dev.list, dev.set and dev.off, and do in fact call these lower-level functions. Specifically, it is recommended to call playDevSet(playState) before any direct drawing operations, to ensure that this is the current graphics device.

See Also

playwith.API

Examples

Run this code
if (interactive()) {

playwith(plot(1:10))
play.first <- playDevCur()
playwith(plot(20:1), new=TRUE)

## show the first window again
playDevSet(play.first)
playDevCur()

## replace it
playwith(plot(1:100))

playDevList()

## clean up
playDevOff()
invisible(lapply(playDevList(), playDevOff))

}

Run the code above in your browser using DataLab