createD: Computation of a Euclidean distance matrix

View source: R/createD.R

createDR 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

kevclus

Examples

data(fourclass)
x<-as.matrix(fourclass[,1:2])
dist<-createD(x,k=10)
dim(dist$D)
dim(dist$J)


evclust documentation built on Nov. 9, 2023, 5:05 p.m.