Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate_cost

Simulate cost data


Description

This function generates cost layers using random field models. By default, it returns spatially auto-correlated integer values.

Usage

simulate_cost(
  x,
  n = 1,
  model = RandomFields::RPpoisson(RandomFields::RMtruncsupport(radius = raster::xres(x)
    * 10, RandomFields::RMgauss())),
  transform = identity,
  ...
)

Arguments

x

RasterLayer object to use as a template.

n

integer number of species to simulate.

model

RandomFields::RP() model object to use for simulating data.

transform

function to transform values output from the random fields simulation.

...

additional arguments passed to RandomFields::RFsimulate().

Value

RasterStack object.

See Also

Examples

## Not run: 
# create raster
r <- raster(ncol=10, nrow=10, xmn=0, xmx=1, ymn=0, ymx=1)
values(r) <- 1

# simulate data
cost <- simulate_cost(r)

# plot simulated species
plot(cost, main = "simulated cost data")

## End(Not run)

prioritizr

Systematic Conservation Prioritization in R

v7.0.1
GPL-3
Authors
Jeffrey O Hanson [aut] (<https://orcid.org/0000-0002-4716-6134>), Richard Schuster [aut, cre] (<https://orcid.org/0000-0003-3191-7869>), Nina Morrell [aut], Matthew Strimas-Mackey [aut] (<https://orcid.org/0000-0001-8929-7776>), Matthew E Watts [aut], Peter Arcese [aut] (<https://orcid.org/0000-0002-8097-482X>), Joseph Bennett [aut] (<https://orcid.org/0000-0002-3901-9513>), Hugh P Possingham [aut] (<https://orcid.org/0000-0001-7755-996X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.