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

sf::st_as_sf() object representing planning units.

species

terra::rast() object with species distribution data.

spaces

terra::rast() or list of terra::rast() objects. Each elements denotes the spatial distribution for each space. Defaults to NULL such that spaces are generated automatically.

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

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

Note

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