ashSetupLandscape: Establish simulation landscape

View source: R/utilities.R

ashSetupLandscapeR Documentation

Establish simulation landscape

Description

Setup a landscape for Ash for our simulations. everything but the surface is baked into holoSimCell

Usage

ashSetupLandscape(
  brickname = system.file("extdata", "rasters", "ccsm_160kmExtent_maxent.tif", package
    = "holoSimCell"),
  equalsuit = F,
  partialsuit = F,
  cellreduce = 0.45,
  xlim = NULL,
  ylim = NULL,
  timesteps = NULL
)

Arguments

brickname

name of a file of a geotiff object. layers correspond to time clicks in simulations

equalsuit

logical (TRUE / FALSE) indicating whether suitability is assumed to be equal in all cells across the landscape

partialsuit

logical (TRUE / FALSE) indicating whether fractional habitat suitabilities should be used

cellreduce

scalar specifying the proportional reduction in landscape dimensions from the input geotiff file (new dimensions = cellreduce x original dimensions)

xlim

optionally used to define the longitudinal dimension of the output landscape (if no geotiff object is supplied)

ylim

optionally used to define the latitudinal dimension of the output landscape (if no geotiff object is supplied)

timesteps

specifies the temporal dimension (number of time steps) of the output landscape

Details

This function reads in a geotiff raster brick and converts the individual rasters into matrices of habitat suitability. Returns a landscape object to be used in forward demographic simulations.

Value

Returns a landscape object with the following components:

  • details Data frame with the spatial extent of the landscape grid

  • occupied Vector of population IDs for occupied cells in the landscape grid

  • empty Vector of population IDs for empty cells in the landscape grid

  • sampled Vector of population IDs for sampled populations in the landscape grid

  • hab_suit Matrix with species habitat suitability (ranging from zero to one) through time. Rows in the matrix correspond to discrete time units and columns correspond to cells in the landscape

  • sumrast Raster that stores the extent and resolution of the simulation landscape

  • samplocsrast Raster showing the locations of cells that correspond to sampled populations

  • samplocs Simple feature encoding spatial vector data related to the sampling populations and a data frame with metadata of the sampling populations (population id, number of individuals, type of spatial data and coordinates)

  • sampdf Data frame with the spatial location of the sampling populations in the landscape grid

  • NAmask A RasterBrick object used to mask cells that are unsuitable (e.g., covered by glaciers, out of the study region, in large lakes or oceans)

See Also

getpophist2.cells, def_grid_pred2

Examples

library(holoSimCell)
m <- 1
landscape <- ashSetupLandscape(brickname=system.file("extdata", "rasters", "ccsm_160kmExtent_maxent.tif", package = "holoSimCell"),cellreduce=0.45,partialsuit=T)


stranda/holoSimCell documentation built on Aug. 4, 2023, 1:12 p.m.