View source: R/euclidean_distances.R
euclidean_distances | R Documentation |
Euclidian distances
euclidean_distances(
x,
id,
centroid = TRUE,
distance_unit = "m",
keep = NULL,
threshold = NULL,
distParallel = FALSE,
ActiveParallel = FALSE,
pairwise = TRUE,
write_table = NULL
)
x |
object of class sf, sfc, sfg or SpatialPolygons. It must be in a projected coordinate system. |
id |
character. Column name with the patches id. |
centroid |
logical. If centroid is TRUE then the Euclidean distance is calculated from patch centroids, if FALSE the Euclidean distance is calculated from patch edges. |
distance_unit |
character. Set a distance unit, "Makurhini::unit_covert()" compatible unit ("m", "km", "inch", "foot", "yard", "mile"). Default equal to meters "m". |
keep |
numeric. Argument for higher processing speed. Only is available for "edge" distance or centroid equal FALSE, use this option to simplify the geometry and reduce the number of vertices. The value can range from 0 to 1 and is the proportion of points to retain (e.g., 0.02). The higher the value, the higher the speed but the greater uncertainty. |
threshold |
numeric. Distance threshold, pairs of nodes with a distance value above this threshold will be discarded. |
distParallel |
logical or numeric. Only is available for "edge" and "centroid" distance, use this option to parallelize using furrr package and multiprocess plan, default = FALSE. |
ActiveParallel |
logical. It should be TRUE if there is already an open parallelization plan. |
pairwise |
logical. If TRUE a pairwise table is returned (From, To, distance) otherwise it will be a matrix. |
write_table |
character. "" indicates output to the console. |
Pairwise Euclidean distance table
Douglas, David H. and Peucker, Thomas K. (1973) "Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or its Caricature", The Canadian Cartographer, 10(2), pp112-122.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.