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

queueSpatstatLocator {spatstat.utils} | R Documentation

## 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`.

### 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`.

### Value

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

### Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

### See Also

`spatstatLocator`

### Examples

    queueSpatstatLocator(0.5, 0.7)
    queueSpatstatLocator(c(0.3, 0.4), c(0.2, 0.9))
    if(!interactive()) {
       spatstatLocator(2)
       spatstatLocator(1)
    }

[Package spatstat.utils version 1.17-0 Index]