make_dist_mat | R Documentation |
Given a data frame or matrix where the first column corresponds to the x-value and the second column corresponds to the y-value (or vice-versa), returns a matrix where the i-j'th coordinate is the Euclidean distance between the i'th and j'th rows.
make_dist_mat(K)
K |
(data.frame or matrix) A data frame or matrix of coordinates |
(matrix) A matrix of Euclidean distances
K = data.frame(x=c(1, 2, 3), y=c(4, 5, 6)) make_dist_mat(K)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.