createTimeMaps: Create maps describing species range shifts across many time...

View source: R/createTimeMaps.R

createTimeMapsR Documentation

Create maps describing species range shifts across many time periods

Description

Creates maps describing species range shifts across multiple time periods. These maps detail the step-wise expansions and contractions of the species distribution through those time-steps, allowing for the visualization of both unidirectional range shifts (e.g., a range expansion across all time-steps) and more complex dynamics (e.g., a range expansion followed by a range contraction).

Usage

createTimeMaps(
  result_dir,
  time_periods,
  scenarios,
  dispersal,
  contiguous,
  dispersaldata,
  ncores
)

Arguments

result_dir

the directory where the ensembled and binary maps are placed. Each species should have its own sub-directory, and the forecasted/hindcasted binary maps should be placed into directories like so: Species/Scenario/Time. If projectSuit was used to make these maps, this is probably the same as the output argument in that function.

time_periods

a vector of the years in which the projection will occur. The first element should be the original year (the year in which the model was generated). If no precise years are available (e.g., using data from the Last Glacial Maximum), order data from current to least current (furthest into the future/past) and give character strings for the years (e.g., "LGM").

scenarios

a vector of character strings detailing the different climate models used in the forecasted/hindcasted species distribution models.

dispersal

(logical TRUE or FALSE). Are the binary maps given dispersal-constrained maps or non-dispersal-constrained maps? If dispersal rate analyses are not needed, or if the megaSDM::dispersalRate function has yet to be run, this should be set to FALSE (the default).

NOTE: if dispersal = TRUE, then time_periods have to be numeric.

contiguous

(logical TRUE or FALSE) If dispersal = TRUE, do the rasters to be aggregated into the TimeMaps come from the analysis that constrained the suitable habitat at the first time step to the existing occurrences? See the contiguous argument in the dispersalRate() function. Default is FALSE

dispersaldata

either a dataframe or the complete path name of a .csv file with two columns:

Column 1: species name (same as the name used for modelling).

Column 2: average dispersal rate of species in kilometers/year.

ncores

the number of computer cores to parallelize the background point generation on. Default is 1; Using one fewer core than the computer has is usually optimal.

Value

writes both rasters and pdfs of the maps showing the expansion and contraction of each species range across all time-steps for each climate scenario.


brshipley/megaSDM documentation built on Nov. 26, 2024, 6:08 a.m.