Description Usage Arguments Details Value See Also
Count neighbors.
1 |
x |
A landscape object. |
state |
A character value. The state to count. Defaults to the primary
cell state, i.e. the first state given in |
This function is vectorised by using the mapping objects defined by
a previous call of mapping
.
Returns a vector of the counts in the neighborhood of each cell in
the landscape. Neighborhood is specified by the global
mapping
objects, by default the 4-cell neighborhood.
For counting the neighborhood of one target file, e.g. when
doing sequential updating of randomly drawn cells, the function
neighborsij
is slightly faster. However, for such updating
processes we recommend using C++ via Rcpp
(see implementation of
the predator prey model, predprey.R
, for an example).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.