randomize_raster: randomize_raster

Description Usage Arguments Details Value References See Also Examples

View source: R/randomize_raster.R

Description

Randomization algorithm

Usage

1
2
3
4
5
6
7
8
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.

Details

The function randomizes a habitat map (as RasterLayer) as proposed by Harms et al. (2001) as “randomized-habitats procedure”. 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.

Value

list

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

1
2
3
4
5
## Not run: 
landscape_classified <- classify_habitats(landscape, classes = 5)
landscape_random <- randomize_raster(landscape_classified, n_random = 19)

## End(Not run)

mhesselbarth/SHAR documentation built on Oct. 17, 2020, 8:58 p.m.