sim.species {raptr} | R Documentation |
Simulate species distribution data for RAP
Description
This function simulates species distributions for RAP.
Usage
sim.species(x, ...)
## S3 method for class 'SpatRaster'
sim.species(x, n = 1, model = "normal", ...)
## S3 method for class 'SpatialPolygons'
sim.species(x, res, n = 1, model = "normal", ...)
## S3 method for class 'sf'
sim.species(x, res, n = 1, model = "normal", ...)
Arguments
x |
|
... |
not used. |
n |
|
model |
|
res |
|
Value
terra::rast()
with layers for each species.
Examples
## Not run:
# make polygons
sim_pus <- sim.pus(225L)
# simulate 1 uniform species distribution using SpatRaster
s1 <- sim.species(blank.raster(sim_pus, 1), n = 1, model = "uniform")
# simulate 1 uniform species distribution based on sf
s2 <- sim.species(sim_pus, res = 1, n = 1, model = "uniform")
# simulate 1 normal species distributions
s3 <- sim.species(sim_pus, res = 1, n = 1, model = "normal")
# simulate 1 bimodal species distribution
s4 <- sim.species(sim_pus, res = 1, n = 1, model = "bimodal")
# simulate 1 species distribution using a random field
s5 <- sim.species(sim_pus, res = 1, n = 1, model = 0.2)
# plot simulations
par(mfrow = c(2,2))
plot(s2, main = "constant")
plot(s3, main = "normal")
plot(s4, main = "bimodal")
plot(s5, main = "random field")
## End(Not run)
[Package raptr version 1.0.1 Index]