SpaDES (version 1.1.4)

randomPolygons: randomPolygons

Description

Produces a raster of with random polygons of varying parameters, using the Modified Random Cluster algorithm of Saura and Martinez-Millan (2000).

Usage

randomPolygons(ras = raster(extent(0, 15, 0, 15), res = 1), p = 0.1,
  A = 0.3, speedup = 1, numTypes = 1, minpatch = 2, ...)

Arguments

ras
A raster that whose extent will be used for the randomPolygons
p
Numeric vector. Parameter to control fragmentation. If this is a vector, then there will be a polygon map produced with length(p) unique levels.
A
Numeric vector. Parameter for expected proportion of habitat. If this is a vector, then there will be a polygon map produced with length(A) unique levels.
speedup
An index of how much faster than normal to generate maps. This is achieved by aggregating then disagregating, so that the resulting raster is the same extent as ras.
numTypes
Numeric value. The number of unique polygon types to use. This will be overridden by p, A or minpatch, if any of these are vectors.
minpatch
Numeric vector. Integer minimum size of patch. If this is a vector, there will be a polygon map produced with length(A) unique levels.
...
Additional arguments to randomHabitat.

Value

  • A map of extent ext with random polygons.

Details

This is a wrapper for the randomHabitat function in the secr package. The two main additions are the speedup argument which allows for faster map generation for large rasters and addition of multiple unique polygon values, using code drawn from http://www.guru-gis.net/generate-a-random-landscape/.

References

Saura, S. and Martinez-Millan, J. (2000) Landscape patterns simulation with a modified random clusters method. Landscape Ecology, 15, 661--678.

See Also

randomHabitat and raster

Examples

Run this code
r1 <- randomPolygons(p = c(0.1, 0.3, 0.5), A = 0.3)
Plot(r1, cols = c("white", "dark green", "blue", "dark red"), new = TRUE)

Run the code above in your browser using DataLab