xyCoords {playwith}R Documentation

Get playwith plot data points

Description

Part of the playwith Application Programming Interface.

Usage

xyCoords(playState, space = "plot")
xyData(playState, space = "plot")

Arguments

playState a playState object representing the plot, window and device.
space character, the plot space for which to get data. This is only relevant to multi-panel lattice plots, where data is split across panels. In this case, if space="page", the combined data from all panels is returned. See the space argument to playDo.

Details

xyCoords is analogous to xy.coords.

xyData is the same but does not convert the data to numeric. Thus the returned data objects may be factors, time series, etc.

Value

the returned value is a list with elements x and y, which are numeric vectors in the case of xyCoords.
For lattice plots, the output is similar to that returned by trellis.panelArgs, so can include elements such as subscripts. In addition, the x and y vectors are recycled to the same length, and coordinates of qqmath plots are automatically calculated.

Author(s)

Felix Andrews felix@nfrac.org

See Also

playwith.API

Examples

if (interactive()) {

library(lattice)
x <- as.Date("1990-01-01") + 1:20 - 1
ab <- rep(c("a", "b"), each=10)
playwith(xyplot(1:20 ~ x | ab))
playState <- playDevCur()
xyCoords(playState, space="packet 2")
xyData(playState, space="packet 2")
xyData(playState, space="page")

}

[Package playwith version 0.8.51 Index]