Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist1

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 \times nc numeric matrix of coordinates.

Value

An nr \times nr matrix of Euclidean distances.

Author(s)

Joshua French

See Also

Examples

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

SpatialTools

Tools for Spatial Data Analysis

v1.0.4
GPL (>= 2)
Authors
Joshua French <joshua.french@ucdenver.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.