powered by
From an nb list and point geometry, return a list of distances for each observation's neighbors list.
st_nb_dists(x, nb, longlat = NULL)
a list where each element is a numeric vector.
an object of class sfc.
sfc
a neighbor list for example created by st_contiguity()
st_contiguity()
TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers. See ?spdep::nbdists() for more.
TRUE
?spdep::nbdists()
Utilizes spdep::nbdists() for distance calculation.
spdep::nbdists()
Other weights: st_inverse_distance(), st_kernel_weights(), st_weights()
st_inverse_distance()
st_kernel_weights()
st_weights()
geo <- sf::st_geometry(guerry) nb <- st_contiguity(geo) dists <- st_nb_dists(geo, nb) head(dists)
Run the code above in your browser using DataLab