View source: R/create_neighbourhood.R
create_neighbourhood | R Documentation |
Create neighbourhood
create_neighbourhood(cells, matrix, directions = 4)
cells |
Matrix with cell ids of focal cells. |
matrix |
Matrix in which cells are located. |
directions |
Integer with cells neighbourhood rule: 4 (rook's case), 8 (queen's case). |
Get cell ids of all neighbouring cells. The neighbourhoood rule can be specified and is either rook's case (4 neighbours) or queen's case (8 neighbours).
matrix
randomize_raster
## Not run:
mat <- matrix(1, nrow= 10, ncol = 10)
cell_id <- rbind(cbind(3,5), cbind(7,1))
create_neighbourhood(cell_id, mat)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.