This function prepares spatially explicit planning unit, species data, and landscape data layers for RAP processing.

  spaces = NULL, = 0.2, = 0.2,
  n.demand.points = 100L,
  kernel.method = c("ks", "hypervolume")[1],
  quantile = 0.5,
  species.points = NULL,
  n.species.points = ceiling(0.2 * raster::cellStats(species, "sum")), = TRUE,
  scale = TRUE,
  verbose = FALSE,



sp::SpatialPolygons() with planning unit data.


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


list of/or raster::raster() representing projects of attribute space over geographic space. Use a list to denote separate attribute spaces.

numeric vector for area targets (%) for each species. Defaults to 0.2 for each attribute space for each species.

numeric vector for attribute space targets (%) for each species. Defaults to 0.2 for each attribute space for each species and each space.


integer number of demand points to use for each attribute space for each species. Defaults to 100L.


character name of kernel method to use to generate demand points. Use either "ks" or "hypervolume".


numeric quantile to generate demand points within. If species.points intersect. Defaults to 0.5.


list of/or sp::SpatialPointsDataFrame() or sp::SpatialPoints() with species presence records. Use a list of objects to represent different species. Must have the same number of elements as species. If not supplied then use n.species.points to sample points from the species distributions.


numeric vector specifying the number points to sample the species distributions to use to generate demand points. Defaults to 20% of the distribution.

logical should the geographic space be considered an attribute space?


logical scale the attribute spaces to unit mean and standard deviation? This prevents overflow. Defaults to TRUE.


logical print statements during processing?


additional arguments to calcBoundaryData() and calcSpeciesAverageInPus().

See also


# load data data(cs_pus, cs_spp, cs_space) # \dontrun{ # make RapData object using the first 10 planning units in the dat x <- make.RapData(cs_pus[1:10,], cs_spp, cs_space, = TRUE) # print object print(x)
#> RapData object.
#> Number of planning units: 10
#> Number of species: 4
#> Number of attribute spaces: 2
# }