nbdists {spdep} | R Documentation

## Spatial link distance measures

### Description

Given a list of spatial neighbour links (a neighbours list of object type `nb`), the function returns the Euclidean distances along the links in a list of the same form as the neighbours list. If lonlat = TRUE, Great Circle distances are used.

### Usage

    nbdists(nb, coords, lonlat = FALSE)

### Arguments

`nb` | an object of class `nb`
`coords` | matrix of point coordinates
`lonlat` | TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers

### Value

A list with class `nbdist`

### Author(s)

Roger Bivand Roger.Bivand@nhh.no

### See Also

`summary.nb`, `nb2listw`

### Examples

    data(columbus)
    dlist <- nbdists(col.gal.nb, coords)
    dlist <- lapply(dlist, function(x) 1/x)
    stem(unlist(dlist))

[Package spdep version 0.3-25 Index]