Skip to contents

Generates simulated species data using Gaussian random fields.

Usage

simulate_species(x, n, scale)

# S3 method for Raster
simulate_species(x, n = 1, scale = 0.5)

# S3 method for SpatRaster
simulate_species(x, n = 1, scale = 0.5)

Arguments

x

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

n

integer number of layers to simulate. Defaults to 1.

scale

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

Value

A terra::rast() object with values between zero and one.

See also

Other simulations: simulate_cost(), simulate_data()

Examples

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

# simulate data for 4 species
spp <- simulate_species(r, 4)

# plot simulated species
plot(spp, main = "simulated species distributions", axes = FALSE)

# }