View source: R/AuxiliaryFunctions_USER.R
dist2Dmatrix | R Documentation |
It computes the Euclidean distance matrix for a set of coordinates.
dist2Dmatrix(coords)
coords |
2D spatial coordinates of dimensions n\times 2. |
An n\times n distance matrix.
Katherine L. Valeriano, Alejandro OrdoƱez, Christian E. Galarza, and Larissa A. Matos.
n = 100 set.seed(1000) x = round(runif(n,0,10), 5) # X coordinate y = round(runif(n,0,10), 5) # Y coordinate Mdist = dist2Dmatrix(cbind(x, y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.