Neighbour graphs: knn (k nearest, ties by index, as
spdep::knn2nb(knearneigh())), distance (\(d_{min} <
d_{ij} \le threshold\), spdep::dnearneigh), gabriel and
relative (spdep::gabrielneigh, relativeneigh) and
delaunay; valued weights inverse (\(d^{-\alpha}\) in the
band) and kernel (uniform, triangular, Epanechnikov, quartic or
Gaussian kernel of \(d/h\), h adaptive k-th neighbour distance by
default). Coding styles of spdep::nb2listw: B, W, C, U, S
(Tiefelsdorf, Griffith and Boots 1999) and minmax. Also returns the
neighbour lists, islands, connected components, sparsity and the
constants S0, S1, S2.
Usage
SpatialWeights(
coords,
method = "knn",
k = 5L,
threshold = NULL,
row_standardize = TRUE,
style = NULL,
d_min = 0,
alpha = 1,
bandwidth = NULL,
kernel = "gaussian"
)Arguments
- coords
Coordinates (n x 2).
- method
"knn","distance","inverse","kernel","gabriel","relative"or"delaunay".- k
Neighbours for knn and the adaptive bandwidth.
- threshold
Upper distance (default median inter-point distance).
- row_standardize
Row-standardise when
styleisNULL.- style
Coding style.
- d_min
Lower distance.
- alpha
Inverse-distance power.
- bandwidth
Kernel bandwidth.
- kernel
Kernel name.
Value
List with W, neighbours, style,
n_islands, components, n_components,
sparsity, S0, S1, S2, symmetric,
mean_neighbours.
