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))
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)
an object of type ‘matrix’.
the lower bound to the number of neighbors for a k-NN graph.
neighborhood radius for an epsilon graph.
the parameter k is ignored.
the parameter eps is ignored.
the metric to used to compute distances.
a m x p ‘matrix’. If NULL distances between argument x and x are computed.