Skip to contents

Generates simulated cost data using Gaussian random fields.

Usage

simulate_cost(x, n, intensity, sd, scale)

# S3 method for Raster
simulate_cost(x, n = 1, intensity = 100, sd = 20, scale = 2.5)

# S3 method for SpatRaster
simulate_cost(x, n = 1, intensity = 100, sd = 20, scale = 2.5)

Arguments

x

terra::rast() object to use as a template.

n

integer number of layers to simulate. Defaults to 1.

intensity

numeric average value of simulated data. Defaults to 100.

sd

numeric standard deviation of simulated data. Defaults to 20.

scale

numeric parameter to control level of spatial auto-correlation in the simulated data. Defaults to 2.5.

Value

A terra::rast() object with integer values greater than zero.

See also

Other simulations: simulate_data(), simulate_species()

Examples

# \dontrun{
# create raster
r <- terra::rast(
  ncols = 10, nrows = 10, xmin = 0, xmax = 1, ymin = 0, ymax = 1, vals = 1
)

# simulate data
cost <- simulate_cost(r)

# plot simulated species
plot(cost, main = "simulated cost data", axes = FALSE)

# }