Create a neutral landscape model with categories and clustering based on neighborhood characteristics.

nlm_neigh(ncol, nrow, resolution = 1, p_neigh, p_empty, categories = 3,
  neighbourhood = 4, proportions = NA, rescale = TRUE)



Number of columns forming the raster.


Number of rows forming the raster.


Resolution of the raster.


Probability of a cell will turning into a value if there is any neighbor with the same or a higher value.


Probability a cell receives a value if all neighbors have no value (i.e. zero).


Number of categories used.


The neighbourhood used to determined adjacent cells: `8 ("Moore")` takes the eight surrounding cells, while `4 ("Von-Neumann")` takes the four adjacent cells (i.e. left, right, upper and lower cells).


The algorithm uses uniform proportions for each category by default. A vector with as many proportions as categories and that sums up to 1 can be used for other distributions.


If TRUE (default), the values are rescaled between 0-1.




The algorithm draws a random cell and turns it into a given category based on the probabilities p_neigh and p_empty, respectively. The decision is based on the probability p_neigh, if there is any cell in the Moore- (8 cells) or Von-Neumann-neighborhood (4 cells), otherwise it is based on p_empty. To create clustered neutral landscape models, p_empty should be (significantly) smaller than p_neigh. By default, the Von-Neumann-neighborhood is used to check adjacent cells. The algorithm starts with the highest categorical value. If the proportion of cells with this value is reached, the categorical value is reduced by 1. By default, a uniform distribution of the categories is applied.


Scherer, Cédric, et al. "Merging trait-based and individual-based modelling: An animal functional type approach to explore the responses of birds to climatic and land use changes in semi-arid African savannas." Ecological Modelling 326 (2016): 75-89.


# simulate neighborhood model neigh_raster <- nlm_neigh(ncol = 50, nrow = 50, p_neigh = 0.7, p_empty = 0.1, categories = 5, neighbourhood = 4)
# NOT RUN { # visualize the NLM landscapetools::show_landscape(neigh_raster) # }