Learn R Programming

SpatialTools (version 0.3.2)

dist1: Calculates Euclidean distance of matrix of coordinates

Description

Calculates Euclidean distance of coords matrix of coordinates. Each row of the coords matrix is assumed to be a distinct coordinate.

Usage

dist1(coords)

Arguments

coords
A matrix of dimensions $nr\times nc$

Value

  • dist1 returns a matrix of size $nr\times nr$ containing the Euclidean distances between each pair of coordinates.

See Also

dist2

Examples

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

Run the code above in your browser using DataLab