nlm_mpd: nlm_mpd

Description Usage Arguments Details Value References Examples

View source: R/nlm_mpd.R

Description

Simulates a midpoint displacement neutral landscape model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nlm_mpd(
  ncol,
  nrow,
  resolution = 1,
  roughness = 0.5,
  rand_dev = 1,
  torus = FALSE,
  rescale = TRUE,
  verbose = TRUE
)

Arguments

ncol

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

nrow

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

resolution

[numerical(1)]
Resolution of the raster.

roughness

[numerical(1)]
Controls the level of spatial autocorrelation (!= Hurst exponent)

rand_dev

[numerical(1)]
Initial standard deviation for the displacement step (default == 1), sets the scale of the overall variance in the resulting landscape.

torus

[logical(1)]
Logical value indicating wether the algorithm should be simulated on a torus (default FALSE)

rescale

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

verbose

[logical(1)]
If TRUE (default), the user gets a warning that the functions changes the dimensions to an appropriate one for the algorithm.

Details

The algorithm is a direct implementation of the midpoint displacement algorithm. It performs the following steps:

At each iteration the roughness, an approximation to common Hurst exponent, is reduced.

Value

RasterLayer

References

https://en.wikipedia.org/wiki/Diamond-square_algorithm

Examples

1
2
3
4
5
6
7
8
9
# simulate midpoint displacement
midpoint_displacememt <- nlm_mpd(ncol = 100,
                                 nrow = 100,
                                 roughness = 0.3)
## Not run: 
# visualize the NLM
landscapetools::show_landscape(midpoint_displacememt)

## End(Not run)

NLMR documentation built on Sept. 20, 2021, 9:07 a.m.