playSelectData(playState = playDevCur(), prompt = paste("Click or drag to select data points;", "Right-click or Esc to cancel."), scales = "dynamic", multiview = TRUE, foo = playRectInput(playState, prompt = prompt, scales = scales))
playState
object representing the plot, window and device. splom
). playSelectData
returns NULL
if the user cancelled (e.g. by right-clicking).
Otherwise a list with:space
space
argument to playDo
.
subscripts
data.points
was specified explicitly.
x, y
is.click
pos
pos
argument to text
.
If is.click
is false, this is NULL
.
playRectInput
.
playSelectData
is similar to identify
.
The user is prompted to click or drag to select data points.
If a click, the nearest point is selected, if it is within 11 points.
If it is a drag, all points within the rectangular region are selected.
Note that data points can be selected from one panel of a multi-panel
lattice plot without specifying the panel beforehand.
playRectInput
,
playwith.API
if (interactive()) {
library(lattice)
playwith(xyplot(Sepal.Width ~ Petal.Width | Species, data = iris))
playSelectData()
}
Run the code above in your browser using DataLab