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

dist2

Calculate Euclidean distance matrix between coordinates of two matrices


Description

dist2 takes the matrices of coordinates coords1 and coords2 and returns the inter-Euclidean distances between coordinates.

Usage

dist2(coords1, coords2)

Arguments

coords1

An nr1 \times nc1 numeric matrix of coordinates.

coords2

An nr2 \times nc2 numeric matrix of coordinates.

Value

An nr1 \times nr2 matrix of Euclidean distances.

Author(s)

Joshua French

See Also

dist, dist1

Examples

x1 <- matrix(rnorm(30), ncol = 3)
x2 <- matrix(rnorm(60), ncol = 3)
dist2(x1, x2)

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.