This is a general function to create Rap objects from scratch and solve them to generate solutions.

rap(
  pus,
  species,
  spaces = NULL,
  formulation = c("unreliable", "reliable")[1],
  solve = TRUE,
  ...
)

Arguments

pus

sp::SpatialPolygons() object representing planning units.

species

raster::raster() object with species distribution data.

spaces

list of raster::raster() objects. Each elements denotes the spatial distribution for each space. Defaults to NULL.

formulation

character to indicate if the "unreliable" or "reliable" formulation should be used to generate prioritizations. Defaults to "unreliable".

solve

logical should solutions be generated?

...

arguments are passed to GurobiOpts(), make.RapData(), and RapReliableOpts() or RapUnreliableOpts() functions.

Value

RapSolved() object if solve is TRUE, otherwise an RapUnsolved() is returned.

Note

Type vignette("raptr") to see the package vignette for a tutorial.

See also