Skip to contents

Creates neighbors based on a distance band. By default, creates a distance band with the maximum distance of k-nearest neighbors where k = 1 (the critical threshold) to ensure that there are no regions that are missing neighbors.


st_dist_band(geometry, lower = 0, upper = critical_threshold(geometry), ...)



An sf or sfc object.


The lower threshold of the distance band. It is recommended to keep this as 0.


The upper threshold of the distance band. By default is set to a critical threshold using critical_threshold() ensuring that each region has a minimum of one neighbor.


Passed to spdep::dnearneigh().


a list of class nb

See also

Other neighbors: st_contiguity(), st_knn()


geo <- sf::st_geometry(guerry)
st_dist_band(geo, upper = critical_threshold(geo))
#> ! Polygon provided. Using point on surface.
#> Neighbour list object:
#> Number of regions: 85 
#> Number of nonzero links: 274 
#> Percentage nonzero weights: 3.792388 
#> Average number of links: 3.223529