spatstat.utils (version 1.13-0)

queueSpatstatLocator: Add Coordinates to a Queue for Use by Locator Function

Description

Add the coordinates of a spatial location to a queue. The queue can be accessed by the spatstatLocator function in a non-interactive session.

Usage

queueSpatstatLocator(x, y)

Arguments

x,y

Numeric values, or vectors of the same length, containing spatial coordinates. Any data acceptable to xy.coords.

Value

Integer (invisible). The length of the queue, after inclusion of the new points.

Details

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.

See Also

spatstatLocator

Examples

Run this code
# NOT RUN {
queueSpatstatLocator(0.5, 0.7)
queueSpatstatLocator(c(0.3, 0.4), c(0.2, 0.9))
if(!interactive()) {
   spatstatLocator(2)   
   spatstatLocator(1)
}
# }

Run the code above in your browser using DataCamp Workspace