computeIdxFromDistIdx | R Documentation |
computeIdxFromDistIdx
computes the indices of two
points whose distance appears at given position in a distance matrix
(as computed by dist
).
computeIdxFromDistIdx(n,
i)
n |
number of points |
i |
index into the distance matrix |
a vector of two indices of points whose distance appears at given position in a distance matrix.
Tomas Sieger
computeDistIdx
x <- 1:10
d <- dist(x)
# entries holding distances between point 3 and 7
i<-computeDistIdx(length(x), 3, 7)
print(i)
# restore indices of the points:
ii<-computeIdxFromDistIdx(length(x), i)
print(ii)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.