Description Usage Arguments Value Examples
knn
returns the indices and distances of the k nearest neighbours of each sample.
1 
dist 
A numeric matrix, data frame or " 
k 
The maximum number of nearest neighbours to search. 
self_loops 

A list containing two matrices indices
and distances
1 2 3 4 5 6 7 8 9 10 11 12  ## Calculate the kNN distances within a set of samples
x < matrix(rnorm(50*10, mean=0, sd=1), ncol=10)
dist < dist(x)
knnd < knn(dist, 10)
plot(density(knnd$distances))
## Calculate the kNN distances between two sets of samples
library(dynutils)
y < matrix(rnorm(100*10, mean=1, sd=2), ncol=10)
dist < calculate_distance(x, y, "euclidean")
knnd < knn(dist, 10)
plot(density(knnd$distances))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.