compute_distance: Compute Euclidian distance matrix.

View source: R/compute_distance.R

compute_distanceR Documentation

Compute Euclidian distance matrix.

Description

Compute Euclidian distance matrix.

Usage

compute_distance(x1, x2 = NULL)

Arguments

x1

Matrix containing coordinates for the first set of locations.

x2

Matrix containing coordinates for the second set of locations.

Value

A matrix with Euclidean distances between two sets of coordinates x1 and x2. If the second set of coordinates x2 is not specified then a matrix pairwise distances for the first set of coordinates x1 are returned.

Author(s)

Eric W. Fox

Examples

x1 <- matrix(1:6, ncol =2, byrow = TRUE)
x2 <- matrix(7:12, ncol = 2, byrow = TRUE)
compute_distance(x1)
compute_distance(x1,x2)


ericwfox/slmrf documentation built on Feb. 24, 2024, 11:02 p.m.