View source: R/compute_distance_matrix.R
compute_distance_matrix | R Documentation |
compute_distance_matrix()
is a small helper function to help you compute a distance matrix.
For the geographically method to work, is is important that distances between points are not zero. This function allows to add a small random noise to avoid zero distances.
compute_distance_matrix(data, method = "euclidean", add.noise = FALSE)
data |
A dataframe or matrix containing at least two numerical columns. |
method |
method to compute the distance matrix. Ultimately passed to |
add.noise |
TRUE/FALSE set to TRUE to add a small noise to the distance matrix. Noise |
a distance matrix, usable in gwl_bw_estimation()
coords <- data.frame("Lat" = rnorm(200), "Long" = rnorm(200))
distance_matrix <- compute_distance_matrix(coords)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.