create2dData | R Documentation |
create2dData
allows you to interactively create a 2D data set
by clicking points in 2D.
create2dData(xyRanges = c(0,
1, 0, 1), setupDevice = TRUE,
verb = 1, ...)
xyRanges |
ranges of 2D space (a numeric vector of length 4 giving the xmin, xma, ymin, and ymax limits) |
setupDevice |
logical flag specifying whether to setup the graphical device. Setting to FALSE enables to call ‘create2dData’ several times getting incrementally more and more points. |
verb |
verbosity level |
... |
optinal parameters passed to ‘points’ |
The user places points in 2D by clicking in a graphical device, and gets coordinates of the clicked points.
For the usual ‘X11’ device the identification process is terminated by pressing any mouse button other than the first. For the ‘quartz’ device the process is terminated by pressing either the pop-up menu equivalent (usually second mouse button or ‘Ctrl’-click) or the ‘ESC’ key.
a list of ‘x’ and ‘y’, each holding the coordinates of selected points
Tomas Sieger
identify
if (interactive()) {
# create first sample
xy<-create2dData()
print(xy)
# create another sample
xy2<-create2dData(setupDevice=FALSE,col='red',pch=19)
print(xy2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.