Learn R Programming

raptr (version 0.0.3)

sim.space: Simulate attribute space data for RAP

Description

This function simulates attribute space data for RAP.

Usage

sim.space(x, ...)

# S3 method for RasterLayer sim.space(x, d = 2, model = RMgauss(), ...)

# S3 method for SpatialPolygons sim.space(x, res, d = 2, model = RMgauss(), ...)

Arguments

x

RasterLayer or SpatialPolygons object delineate the spatial extent to delineate study area.

...

parameters passed to RandomFields.

d

integer number of dimensions. Defaults to 2.

model

RMmodel model to simulate species distributions with. Defaults RPgauss.

res

numeric resolution to simulate distributions. Only needed when SpatialPolygons supplied.

Value

RasterStack with layers for each dimension of the space.

Details

Distributions are simulated by passing model to RFsimulate.

See Also

RFsimulate.

Examples

Run this code
# NOT RUN {
# simulate plannign units
sim_pus <- sim.pus(225L)

# simulate 1d space using RasterLayer
s1 <- sim.space(blank.raster(sim_pus, 1), d=1)

# simulate 1d space using SpatialPolygons
s2 <- sim.space(sim_pus, res=1, d=1)

# simulate 2d space using SpatialPolygons
s3 <- sim.space(sim_pus, res=1, d=2)

# plot simulated spaces
par(mfrow=c(2,2))
plot(s1, main='s1')
plot(s2, main='s2')
plot(s3[[1]], main='s3: first dimension')
plot(s3[[2]], main='s3: second dimension')
# }

Run the code above in your browser using DataLab