R: Pairwise shortest-path distances between points on a linear...

pairdist.lpp {spatstat} | R Documentation

## Pairwise shortest-path distances between points on a linear network

### Description

Given a pattern of points on a linear network, compute the matrix of distances between all pairs of points, measuring distance by the shortest path in the network.

### Usage

    ## S3 method for class 'lpp'
    pairdist(X, ..., method="C")

### Arguments

`X` | Point pattern on linear network (object of class `"lpp"`).
`method` | Optional string determining the method of calculation. Either `"interpreted"` or `"C"`.
`...` | Ignored.

### Details

Given a pattern of points on a linear network, this function computes the matrix of distances between all pairs of points, measuring distance by the shortest path in the network.

If `method="C"` the distances are computed using code in the C language. If `method="interpreted"` then the computation is performed using interpreted R code. The R code is much slower, but is provided for checking purposes.

If two points cannot be joined by a path, the distance between them is infinite (`Inf`).

### Value

A symmetric matrix, whose values are nonnegative numbers or infinity (`Inf`).

### Author(s)

Ang Qi Wei aqw07398@hotmail.com and Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

### See Also

`lpp`

### Examples

       X <- runiflpp(12, simplenet)
       pairdist(X)

[Package spatstat version 1.54-0 Index]