A function to generate a multidimensional landscape with each cell randomly assigned a category number such that the total ratio of category types accross the landscape corresponds to a proportion vector input.
An integer vector with the length of the desired output in each dimension.
An integer vector with a each element containing the number of cells to assign to each category type.
A vector of category labels to attach to each of the assigned category types. If
A vector of length
prod(DimExtents) and with a dimensional extent attribute set to
DimExtents. Each element contains the corresponding category label given in
Cat.Labels to the assigned category type.
Joseph Chipperfield <firstname.lastname@example.org>
Gardner, R. H., Milne, B. T., Turner, M. G. and O'Neill, R. V. (1987) Neutral models for the analysis of broad-scale landscape pattern. Landscape Ecology, 1, 19-28.
With, K. A. (1997) The application of neutral landscape models in conservation biology. Conservation Biology, 11, 1069-1080.
With, K. A. and King A. W. (1997) The use and misuse of neutral landscapes models in ecology. Oikos, 79, 219-229.
1 2 3 4 5 6 7 8 9
# Create a 100 x 100 landscape with 3000 "grass" cells, 2000 "sand" cells, and # 5000 "bog" cells dims.in <- rep(100,2) # Dimension extent props <- c(3000, 2000, 5000) # Proportions of each habitat type cat.labels <- c("grass", "sand", "bog") # Category labels output.map <- PercolationMap(dims.in, props, cat.labels) # Code the outputs into values for display coded.map <- ifelse(output.map == "grass", 1, ifelse(output.map == "sand", 2, 3)) image(coded.map, col = c("green", "yellow", "brown"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.