Description Usage Arguments Value
View source: R/gen_data_utils.R
Given a matrix detailing the position of location in a regular grid, returns a matrix specifying the IDs of immediate neighbours to the right, left, top and bottom of each location.
1  | grid_neibs_ord1(sites, klist)
 | 
sites | 
 a matrix or data.frame with site ID equal to row number and two columns, corresponding to position in x and y  | 
klist | 
 a matrix like the ones returned by consecutive use of spdep::dnearneigh and spdep::nblag where a value higher than 0 implies that the row and column locations are neighbours  | 
A matrix with nrow(sites) rows and four columns containing 
the ID of a location's neighbour in each cardinal direction 
(top, right, bottom and left).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.