Define neighbour relationships according to K-nearest neighbour algorithm.

knn_nb(poly = NULL, k = 10)

Arguments

poly

a sf data frame with polygon geometry

k

numeric, number of nearest neighbour to select with knn algorithm

Value

weighted neighbour matrix in a listw object from spdep package

Details

based on knearneigh function from spdep package