This function generates cost layers using random field models. By default, it returns spatially auto-correlated integer values.

simulate_cost(
  x,
  n = 1,
  model = RandomFields::RPpoisson(RandomFields::RMtruncsupport(radius = raster::xres(x)
    * 10, RandomFields::RMgauss())),
  transform = identity,
  ...
)

Arguments

x

RasterLayer object to use as a template.

n

integer number of species to simulate.

model

RandomFields::RP() model object to use for simulating data.

transform

function to transform values output from the random fields simulation.

...

additional arguments passed to RandomFields::RFsimulate().

Value

RasterStack object.

See also

Examples

# \dontrun{ # create raster r <- raster(ncol=10, nrow=10, xmn=0, xmx=1, ymn=0, ymx=1) values(r) <- 1 # simulate data cost <- simulate_cost(r) # plot simulated species plot(cost, main = "simulated cost data")
# }