Create neighbourhood
create_neighbourhood(cells, matrix, directions = 4)
matrix with cell ids of focal cells.
matrix in which cells are located.
Cells neighbour rule: 4 (rook's case), 8 (queen's case).
matrix
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).
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) # }
Run the code above in your browser using DataLab