Calculate the distance between a pair of spatial boundariesSource:
Calculate the distance between a pair of spatial boundaries
- x, y
Objects of the class
How to measure distance? This can be either
'border'(distance between the borders of
'center'(distance between their centroids).
Time closest to the spatial maps of
yif they represent
slendr_poppopulation boundaries (ignored for general
If the coordinate reference system was specified, a distance in projected units (i.e. meters) is returned. Otherwise the function returns a normal Euclidean distance.
# create two regions on a blank abstract landscape region_a <- region("A", center = c(20, 50), radius = 20) region_b <- region("B", center = c(80, 50), radius = 20) plot_map(region_a, region_b) # compute the distance between the centers of both population ranges distance(region_a, region_b, measure = "center") #>  60 # compute the distance between the borders of both population ranges distance(region_a, region_b, measure = "border") #>  20