dist_subset | R Documentation |
dist
object.Extract a subset of values from a distance matrix. This function also works to re-arrange the rows of a distance matrix, if they are provided in the desired order.
dist_subset(d, idx)
d |
A distance matrix object of class |
idx |
Indices specifying the subset of distances to extract. |
A distance matrix.
m4 <- matrix(1:16, nrow=4, dimnames=list(LETTERS[1:4]))
dm4 <- dist(m4)
dist_subset(dm4, c("A", "B", "C"))
dist_subset(dm4, c("D", "C", "B", "A"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.