createD {evclust} | R Documentation |
Computation of a Euclidean distance matrix
Description
createD
constructs an n x k matrix of Euclidean distances from an n x p matrix
of attribute data. For each object, the distances to k randomly selected objects are
computed.
Usage
createD(x, k)
Arguments
x |
n x p data matrix. |
k |
Number of distances. If missing, an n x n distance matrix is computed. |
Value
A list with two elements:
- D
n x k distance matrix.
- J
n x k matrix of indices. D[i,j] is the Euclidean distance between x[i,] and x[J[i,j],].
See Also
Examples
data(fourclass)
x<-as.matrix(fourclass[,1:2])
dist<-createD(x,k=10)
dim(dist$D)
dim(dist$J)
[Package evclust version 2.0.3 Index]