Learn R Programming

GeoXp (version 1.6.2)

normw: Row-normalize a spatial weight matrix

Description

The function normw() row-normalizes a spatial weight matrix

Usage

normw(w)

Arguments

w
A matrix of size $n x n$

Value

A matrix of size $n x n$

Details

$$W_{ij}=\frac{W_{ij}}{\sum_kW_{ik}}$$

References

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.

See Also

neighbourmap, moranplotmap,makeneighborsw

Examples

Run this code
###
# 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