normw | R Documentation |
The function normw()
row-normalizes a spatial weight matrix
normw(w)
w |
A matrix of size |
W_{ij}=\frac{W_{ij}}{\sum_kW_{ik}}
A matrix of size n \times n
Aragon Y., Thomas-Agnan C., Ruiz-Gazen A., Robidou L.
Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.
neighbourmap
, moranplotmap
,makeneighborsw
###
# data auckland
auckland <- sf::st_read(system.file("shapes/auckland.shp", package="spData")[1])
x.ext <- auckland$Easting[1:10]
y.ext <- auckland$Northing[1:10]
# matrix based on 3 nearest neighbors
W1 <- makeneighborsw(cbind(x.ext, y.ext), method = "both", m = 3, d = 20)
W2 <- normw(W1)
apply(W1[1:10,], 1, sum)
apply(W2[1:10,], 1, sum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.