make_dist_mat: Given a data frame or matrix where the first column...

View source: R/lrk.R

make_dist_matR Documentation

Given a data frame or matrix where the first column corresponds to the x-value and the second column corresponds to the y-value (or vice-versa), returns a matrix where the i-j'th coordinate is the Euclidean distance between the i'th and j'th rows.

Description

Given a data frame or matrix where the first column corresponds to the x-value and the second column corresponds to the y-value (or vice-versa), returns a matrix where the i-j'th coordinate is the Euclidean distance between the i'th and j'th rows.

Usage

make_dist_mat(K)

Arguments

K

(data.frame or matrix) A data frame or matrix of coordinates

Value

(matrix) A matrix of Euclidean distances

Examples

K = data.frame(x=c(1, 2, 3), y=c(4, 5, 6))
make_dist_mat(K)

paulsavala/nebcs documentation built on March 20, 2022, 9:24 a.m.