pick.min.max | R Documentation |
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.
pick.min.max(ds, k = 1)
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 |
A list
with the elements
min.dis |
The |
ind.min.dis |
The indices (i.e. row numbers) of the |
max.dis |
The |
ind.max.dis |
The indices (i.e. row numbers) of the |
Elvan Ceyhan
dist
, ipd.mat
, and ipd.mat.euc
n<-20 #or try sample(1:20,1) Y<-matrix(runif(3*n),ncol=3) ipd<-ipd.mat(Y) pick.min.max(ipd) #or pick.min.max(dist(Y)) pick.min.max(ipd,2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.