This is an alternative to the locator
function. It contains a workaround for a bug that occurs in
RStudio
.
spatstatLocator(n, type = c("p", "l", "o", "n"), ...,
snap.step=NULL, snap.origin=c(0,0))
A list containing components x
and y
which are vectors
giving the coordinates of the identified points in the
user coordinate system, i.e., the one specified by par("usr")
.
Optional. Maximum number of points to locate.
Character specifying how to plot the locations.
If "p"
or "o"
the points are plotted;
if "l"
or "o"
they are joined by lines.
Additional graphics parameters used to plot the locations.
Optional. Spatial coordinates will be rounded to the nearest
multiple of snap.step
. A positive number specifying the step
length, or a vector of 2 positive numbers specifying step lengths
for the \(x\) and \(y\) coordinates.
Optional. Numeric vector of length 2. Coordinates of the origin that will be used when rounding coordinates.
Programmers may like to know that
code which depends on spatstatLocator
can be tested in a non-interactive session,
if the coordinates are previously queued using
queueSpatstatLocator
.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.
This is a replacement/workaround for the locator
function in some versions of RStudio which do not seem to
recognise the option type="p"
.
See locator
for a description of the
behaviour.
If snap.step
is given, then the coordinates of the selected
locations will be rounded to the nearest multiple of snap.step
.
queueSpatstatLocator
if(interactive()) locator(1, type="p")
Run the code above in your browser using DataLab