View source: R/calc_toroidal_dist.R
toroidal_dist_matrix_optimized | R Documentation |
Optimized function to compute toroidal distance matrix over a rectangular domain
toroidal_dist_matrix_optimized(location_matrix, x_bound, y_bound)
location_matrix |
a 2 column matrix of (x,y) coordinates. |
x_bound |
the upper bound for the x dimension. |
y_bound |
the upper bound for the y dimension. |
a matrix of toroidal distances.
# Generate a matrix of locations
location_matrix <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
x_bound <- 10
y_bound <- 10
# Compute the toroidal distance matrix
toroidal_dist_matrix_optimized(location_matrix, x_bound, y_bound)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.