Usage
adj.raw(x = NULL, cells, directions = 8, sort = FALSE, pairs = TRUE,
include = FALSE, target = NULL, numCol = NULL, numCell = NULL,
match.adjacent = FALSE, cutoff.for.data.table = 10000, torus = FALSE)adj(x = NULL, cells, directions = 8, sort = FALSE, pairs = TRUE,
include = FALSE, target = NULL, numCol = NULL, numCell = NULL,
match.adjacent = FALSE, cutoff.for.data.table = 10000, torus = FALSE)
Arguments
x
Raster* object for which adjacency will be calculated.
cells
vector of cell numbers for which adjacent cells should be found. Cell numbers start with 1 in the upper-left corner and increase from left to right and from top to bottom
directions
the number of directions in which cells should be connected: 4 (rook's case), 8 (queen's case), or 'bishop' to connect cells with one-cell diagonal moves. Or a neigborhood matrix (see Details)
sort
logical. Whether the outputs should be sorted or not, using Cell IDs of the
from cells (and to cells, if match.adjacent
is TRUE.
pairs
logical. If TRUE, a matrix of pairs of adjacent cells is returned. If FALSE, a vector of cells adjacent to cells is returned
include
logical. Should the focal cells be included in the result?
target
a vector of cells that can be spread to. This is the inverse of a mask.
numCol
numeric indicating number of columns in the raster. Using this with numCell is a bit faster execution time.
numCell
numeric indicating number of cells in the raster. Using this with numCol is a bit faster execution time.
match.adjacent
logical. Should the returned object be the same as the adjacent
function in the raster package.
cutoff.for.data.table
numeric. Above this value, the function uses data.table which is
faster with large numbers of cells.
torus
Logical. Should the spread event wrap around to the other side of the raster.
Default is FALSE.