Generates simulated species data using Gaussian random fields. Specifically, it outputs spatially auto-correlated raster data with values between zero and one.

simulate_species(x, n = 1, scale = 0.5)

Arguments

x

raster::raster() raster 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. Defaults to 0.5.

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 for 4 species
spp <- simulate_species(r, 4)

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

# }