Francesco Perugini
2016-Feb-01 17:34 UTC
[R] R Sig-Geo group - loop for creating spatial matrix
Dear all,I want to create a routine to generate an object for different value of val: z <- c(1,2,3,4,5,6,7,8,9) for (val in z) { neighbors.knn <- knn2nb(knearneigh(coord, val, longlat=F), row.names=cod_pro,sym=F) } However, it seems it does not work. How to store the neighbors.knn created matrix befoire being overwritten. In other words, I want to create multiple spatial matrix, say, for different k neighbours. Thanks a lot for any help. francper [[alternative HTML version deleted]]