| def_grid_pred2 | R Documentation |
Takes multiple spatial inputs (range shapefiles, enm rasters) and makes a grid for the genetic simulations
def_grid_pred2(
pred = NULL,
samps = NULL,
raster.proj = "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
)
pred |
is a raster stack with layers of hab suitability (assumes [0-1] with larger numbers better suitability) |
samps |
locations of actual genetic samples. SpatialPoints object assumed in same proj as raster input |
raster.proj |
the proj.4 string to impose on the raster enm (if not already specified) (defaults albers) |
Takes a raster stack and converts into the internal habitat suitability matrix (rows are time and columns represent cell IDs). This object is returned along with rasters delineating the locations of genetic samples and sum of suitabilities for each cell through time. These are all returned from the function as a new 'landscape' object, which formst he main input into /codegetpophist2.cells.
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)
ashSetupLandscape, getpophist2.cells
library(holoSimCell)
rs <- raster::brick(system.file("extdata/rasters/ccsm_160kmExtent_maxent.tif", package = "holoSimCell"))
newrs <- newLandscapeDim(rs,0.45)
land <- def_grid_pred2(pred=newrs, samps=transSampLoc(pts, range.epsg=4326, raster.proj=crs(rs)@projargs), raster.proj=crs(rs)@projargs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.