
Last chance! 50% off unlimited learning
Sale ends in
Takes as input a matrix gridMat with the following format: 0 means a site is included in the study area, and nonzero values mean the site is not included. Returns an adjacency matrix for the study sites, where sites at a Manhattan distance of exactly kNN are considered neighbors.
adjMat(m, n, boundary = FALSE)
height of the grid
width of the grid
surround grid by an external boundary, defaults to FALSE
a list containing a sparse adjacency matrix for a square lattice, and the vector of the points not on the edge
# NOT RUN {
mat=adjMat(10,10)
# }
Run the code above in your browser using DataLab