Description Usage Arguments Value Examples
View source: R/cm_findLinearNeighbours.R
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.
1 | 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.
1 2 3 4 5 6 7 8 | 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.