| adjPairsMatrix | R Documentation |
Computes 4- or 8-direction neighbour pairs (from, to) for every input cell and filters out neighbours that fall off the raster top/bottom or wrap across left/right edges. Returns a 2-column integer matrix with column names "from" and "to". Equivalent to adj(..., pairs = TRUE) but without the data.table allocation/coercion overhead.
adjPairsMatrix(cells, numCol, numCell, directions)
cells |
integer vector of source cell indices (1-based) |
numCol |
integer; number of raster columns |
numCell |
integer; total number of raster cells |
directions |
integer; either 4 or 8 |
A 2-column integer matrix with columns named from and to.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.