powered by
Count neighbors in a connectivity matrix
n_nbs(C)
A vector with the number of non-zero values in each row of C
C
A connectivity matrix
data(sentencing) C <- shape2mat(sentencing) sentencing$Ni <- n_nbs(C)
Run the code above in your browser using DataLab