Learn R Programming

SpaDES.tools (version 1.0.1)

neutralLandscapeMap: Produce a neutral landscape using a midpoint displacement algorithm

Description

This is a wrapper for the nlm_mpd function in the NLMR package. The main addition is that it makes sure that the output raster conforms in extent with the input raster x, since nlm_mpd can output a smaller raster.

Usage

neutralLandscapeMap(x, pad = 10L, ...)

Value

A RasterLayer with same extent as x, with randomly generated values.

Arguments

x

A RasterLayer to use as a template.

pad

Integer. Number of cells by which to pad x internally to ensure nlm_mpd produces a raster corresponding to the dimensions of x.

...

Further arguments passed to NLMR::nlm_mpd

See Also

nlm_mpd

Examples

Run this code
if (FALSE) {
  if (require(NLMR)) {
    library(raster)
    nx <- ny <- 100L
    r <- raster(nrows = ny, ncols = nx, xmn = -nx/2, xmx = nx/2, ymn = -ny/2, ymx = ny/2)
    map1 <- neutralLandscapeMap(r,
                                roughness = 0.65,
                                rand_dev = 200,
                                rescale = FALSE,
                                verbose = FALSE)
    if (interactive()) Plot(map1)
  }
}

Run the code above in your browser using DataLab