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

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/NNCTFunctions.r

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

1
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

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

nnspat documentation built on May 10, 2021, 9:06 a.m.