R/normw.R

`normw` <-
function(w)
{
# initialisation
res <- dim(w)
if(res[1]!=res[2]) stop("w is not a squared matrix") 

non.0<-which(apply(w,2,sum)!=0)
w[non.0,]<-w[non.0,]/apply(w,1,sum)[non.0]

return(w)
}

Try the GeoXp package in your browser

Any scripts or data that you put into this service are public.

GeoXp documentation built on May 2, 2019, 4:54 p.m.