dist2full: Converts a lower triangular distance matrix to a full...

View source: R/NNCTFunctions.R

dist2fullR Documentation

Converts a lower triangular distance matrix to a full distance matrix

Description

Converts a lower triangular distance matrix to a full distance matrix with zeroes in the diagonal. The input is usually the result of the dist function in the stats package. This function is adapted from Everitt's book (\insertCiteeveritt:2004;textualnnspat)

Usage

dist2full(dis)

Arguments

dis

A lower triangular matrix, resulting from the dist function in the stats package

Value

A square (symmetric) distance matrix with zeroes in the diagonal.

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

dist

Examples

#3D data points
n<-3
X<-matrix(runif(3*n),ncol=3)
dst<-dist(X)
dist2full(dst)


nnspat documentation built on Aug. 30, 2022, 9:06 a.m.