dist1 {SpatialTools}R Documentation

Calculate Euclidean distance matrix for a matrix of coordinates

Description

dist1 takes a matrix of coordinates and returns the Euclidean distance matrix of the coordinates. It does this using a compiled C program, so it is faster than the builtin R dist function.

Usage

dist1(coords)

Arguments

coords

An nr×ncnr \times nc numeric matrix of coordinates.

Value

An nr×nrnr \times nr matrix of Euclidean distances.

Author(s)

Joshua French

See Also

dist, dist2

Examples

x <- matrix(rnorm(30), ncol = 3)
dist1(x)

[Package SpatialTools version 1.0.5 Index]