###
# data auckland
data(auckland)
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)
Run the code above in your browser using DataLab