NLMR (version 1.0)

nlm_randomcluster: nlm_randomcluster

Description

Simulates a random cluster nearest-neighbour neutral landscape.

Usage

nlm_randomcluster(ncol, nrow, resolution = 1, p, ai = c(0.5, 0.5),
  neighbourhood = 4, rescale = TRUE)

Arguments

ncol

[integer(1)] Number of columns forming the raster.

nrow

[integer(1)] Number of rows forming the raster.

resolution

[numerical(1)] Resolution of the raster.

p

[numerical(1)] Defines the proportion of elements randomly selected to form clusters.

ai

Vector with the cluster type distribution (percentages of occupancy). This directly controls the number of types via the given length.

neighbourhood

[numerical(1)] Clusters are defined using a set of neighbourhood structures, 4 (Rook's or von Neumann neighbourhood) (default), 8 (Queen's or Moore neighbourhood).

rescale

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

Value

Raster with random values ranging from 0-1.

Details

This is a direct implementation of steps A - D of the modified random clusters algorithm by Saura & Mart<U+00ED>nez-Mill<U+00E1>n (2000), which creates naturalistic patchy patterns.

References

Saura, S. & Mart<U+00ED>nez-Mill<U+00E1>n, J. (2000) Landscape patterns simulation with a modified random clusters method. Landscape Ecology, 15, 661 <U+2013> 678.

Examples

Run this code
# NOT RUN {
# simulate random clustering
random_cluster <- nlm_randomcluster(ncol = 30, nrow = 30,
                                     p = 0.4,
                                     ai = c(0.25, 0.25, 0.5))
# }
# NOT RUN {
# visualize the NLM
landscapetools::show_landscape(random_cluster)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace