weight = function(mun,u_m,lat,long){
u = which(u_m==mun)
pos = cbind(lat,long)
distt = vector(length=nrow(pos))
for( i in 1:nrow(pos))
{
distt[i] = dist(rbind(pos[u,],pos[i,]))
}
distt = distt[-u]
tau_m = median(distt)#.5#max(distt)
C_n = exp((-0.5*(distt)^2)/tau_m^2)
omega = C_n/sum(C_n);names(omega) = c(mun[-u])
return(list(om = omega))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.