pick.min.max: Smallest and Largest Distances in a Distance Matrix
Description
This function finds and returns the k smallest and k largest distances in a distance matrix or distance object,
and also provides pairs of objects these distances correspond to.
The code is adapted from
http://people.stat.sc.edu/Hitchcock/chapter1_R_examples.txt.
Usage
pick.min.max(ds, k = 1)
Value
A list with the elements
min.dis
The k smallest distances in ds
ind.min.dis
The indices (i.e., row numbers) of the k pairs of object which has the
k smallest distances in ds
max.dis
The k largest distances in ds
ind.max.dis
The indices (i.e., row numbers) of the k pairs of object which has the
k largest distances in ds
Arguments
ds
A distance matrix or a distance object
k
A positive integer representing the number of (min and max) distances to be presented, default is \(k=1\)