create_neighbourhood: create_neighbourhood

Description Usage Arguments Details Value See Also Examples

View source: R/create_neighbourhood.R

Description

Create neighbourhood

Usage

1
create_neighbourhood(cells, matrix, directions = 4)

Arguments

cells

matrix with cell ids of focal cells.

matrix

matrix in which cells are located.

directions

Cells neighbour rule: 4 (rook's case), 8 (queen's case).

Details

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).

Value

matrix

See Also

randomize_raster

Examples

1
2
3
mat <- matrix(1, nrow= 10, ncol = 10)
cell_id <- rbind(cbind(3,5), cbind(7,1))
create_neighbourhood(cell_id, mat)

mhesselbarth/SHAR documentation built on Oct. 17, 2020, 8:58 p.m.