Description Usage Arguments Details Value Author(s) See Also Examples
Part of the playwith Application Programming Interface.
1 2 3 4 5 6 | 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 |
a |
prompt |
text to display in the prompt. |
scales |
the default allows the user to hold Shift while dragging, to constrain the selection to x or y scales. Otherwise this should be one or more of "x" and "y", specifying which axes to select along. |
multiview |
to return a matrix of x and y when the plot contains
multiple positions for the same points (e.g. |
foo |
rectangular plot region structure, usually generated interactively. |
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.
playSelectData
returns NULL
if the user cancelled (e.g. by right-clicking).
Otherwise a list with:
|
character, specifies the plot space in which data points were selected.
See the |
|
indices of the data points selected. This relies on the data being guessed
correctly from the plot call, unless |
|
values of the selected data points. |
|
logical, whether it was a click (otherwise a drag). |
|
position of click relative to the closest point,
as in the |
... |
as well as all the other elements returned by
|
Felix Andrews felix@nfrac.org
playRectInput
,
playwith.API
1 2 3 4 5 6 7 | if (interactive()) {
library(lattice)
playwith(xyplot(Sepal.Width ~ Petal.Width | Species, data = iris))
playSelectData()
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.