distance | R Documentation |
Calculate the distance between a pair of spatial boundaries
distance(x, y, measure, time = NULL)
x , y |
Objects of the class |
measure |
How to measure distance? This can be either |
time |
Time closest to the spatial maps of |
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")
# compute the distance between the borders of both population ranges
distance(region_a, region_b, measure = "border")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.