knn_dist function

calculate k nearest neighbours from a distance matrix

calculate k nearest neighbours from a distance matrix

knn_dist(dis, k)

Arguments

  • dis: distance matrix
  • k: number of nearest neighbours (Note that with a tie, the function returns the alphanumerically first one!)