shar (version 1.1)

randomize_raster: randomize_raster

Description

Randomization algorithm

Usage

randomize_raster(raster, n_random = 1, directions = 4,
  return_input = TRUE, simplify = FALSE, verbose = TRUE)

Arguments

raster

RasterLayer.

n_random

Number of randomizations.

directions

Cells neighbour rule: 4 (rook's case), 8 (queen's case).

return_input

The original input data is returned as last list entry

simplify

If n_random = 1 and return_input = FALSE only raster will be returned.

verbose

Print progress report.

Value

list

Details

The function randomizes a habitat map (as RasterLayer) as proposed by Harms et al. (2001) as <U+201C>randomized-habitats procedure<U+201D>. The algorithm starts with an empty habitat map starts to assign random neighbouring cells to each habitat (in increasing order of abundance in observed map). We modified the procedure slightly by increasing a probability to jump to a non-neighbouring cell as the current patch becomes larger.

References

Harms, K. E., Condit, R., Hubbell, S. P., & Foster, R. B. (2001). Habitat associations of trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology, 89(6), 947-959.

See Also

translate_raster adjacent

Examples

Run this code
# NOT RUN {
landscape_classified <- classify_habitats(landscape, classes = 5)
landscape_random <- randomize_raster(landscape_classified, n_random = 19)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab