Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/apiAnnotation.R
Part of the playwith Application Programming Interface.
1 2 3 | playPointInput(playState = playDevCur(), prompt)
playLineInput(playState = playDevCur(), prompt, scales = "dynamic")
playRectInput(playState = playDevCur(), prompt, scales = "dynamic")
|
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. |
playPointInput is similar to locator, but
returns native coordinates in whichever plot space was clicked on.
Device coordinates and normalised device coordinates are also available.
playRectInput and playLineInput allow the user to
interactively draw a rectangle or line.
All these functions return NULL if the user cancelled (e.g. by
right-clicking). Otherwise a list with:
|
character, specifies the plot space in which the user clicked or dragged.
See the |
|
native coordinates of the point or shape in |
|
device coordinates of the point or shape (pixels). |
|
normalised device coordinates of the point or shape. |
|
logical, whether it was a click
(so probably should not be treated as a rectangle or line).
This is not returned by |
|
a |
Felix Andrews felix@nfrac.org
playSelectData, playwith.API
1 2 3 4 5 6 7 8 | if (interactive()) {
library(lattice)
playwith(xyplot(Sepal.Width ~ Petal.Width | Species, data = iris))
playPointInput()
playRectInput()
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.