View source: R/cm_findLinearNeighbours.R
findLinearNeighbours | R Documentation |
Given a vector of cell IDs (cell.ids
) and a vector (blocks
),
which defines the number of blocks / cells per dimension, a list of all
combinations of (linearly) neighbouring cells around each element of
cell.ids
is returned.
findLinearNeighbours(cell.ids, blocks, diag = FALSE)
cell.ids |
[ |
blocks |
[ |
diag |
[ |
[list
of integer(3)
].
List of neighbours. Each list element stands for a combination of
predecessing, current and succeeding cell.
cell.ids = c(5, 84, 17, 23) blocks = c(5, 4, 7) # (1) Considering diagonal neighbours as well: findLinearNeighbours(cell.ids = cell.ids, blocks = blocks, diag = TRUE) # (2) Only consider neighbours which are parellel to the axes: findLinearNeighbours(cell.ids = cell.ids, blocks = blocks)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.