Learn R Programming

SemiSupervised (version 1.0)

knnGraph: Convert a ‘data.frame’ or ‘matrix’ into a k-NN graph or epsilon graph.

Description

These functions are designed to convert data sets or distance matrices to graphs. In addition, the Cosine and Euclidean distance functions are also available. The kgraph functions build a knn graph off of a distance matrix (either square (symm) or non-square (predict))

Usage

knnGraph(x,y,k=6L,nok=FALSE,metric="cosine")
epsGraph(x,y,eps=0.2,noeps=FALSE,metric="cosine")
cosineDist(x,y=NULL)
euclidDist(x,y=NULL)

Arguments

x

an object of type ‘matrix’.

k

the lower bound to the number of neighbors for a k-NN graph.

eps

neighborhood radius for an epsilon graph.

nok

the parameter k is ignored.

noeps

the parameter eps is ignored.

metric

the metric to used to compute distances.

y

a m x p ‘matrix’. If NULL distances between argument x and x are computed.

See Also

s4pm, jtharm