simulate_cost: Simulate cost data

View source: R/simulate.R

simulate_costR Documentation

Simulate cost data

Description

Generates simulated cost data using Gaussian random fields.

Usage

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

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

## S3 method for class '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

## Not run: 
# 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)

## End(Not run)


prioritizr/prioritizr documentation built on March 4, 2024, 3:54 p.m.