The spatstatLocator
function is a replacement
for the locator
function
that can be used to test software which depends on user input.
When queueSpatstatLocator(x,y)
is called, the coordinate
data x,y
are saved in a queue. The first-listed coordinate
pair x[1], y[1]
is at the front of the queue. Subsequently, when
spatstatLocator
is called, the coordinates are
taken from the front of the queue and returned as if they had been
clicked by the user.
This only works in a non-interactive
session, that is, when interactive()
returns FALSE
.