Package 'dispeRse'

Title: Simulation of Demic Diffusion with Environmental Constraints
Description: Simulates demic diffusion building on models previously developed for the expansion of Neolithic and other food-producing economies during the Holocene (Fort et al. (2012) <doi:10.7183/0002-7316.77.2.203>, Souza et al. (2021) <doi:10.1098/rsif.2021.0499>). Growth and emigration are modelled as density-dependent processes using logistic growth and an asymptotic threshold model. Environmental and terrain layers, which can change over time, affect carrying capacity, growth and mobility. Multiple centres of origin with their respective starting times can be specified.
Authors: Jonas Gregorio de Souza [aut, cre]
Maintainer: Jonas Gregorio de Souza <[email protected]>
License: MIT + file LICENSE
Version: 1.1
Built: 2024-11-10 04:14:29 UTC
Source: https://github.com/jgregoriods/disperse

Help Index


Convert from geographic coordinates in a given projection system to the relative position in rows and columns of a grid.

Description

Convert from geographic coordinates in a given projection system to the relative position in rows and columns of a grid.

Usage

.to_grid(coords, grid)

Arguments

coords

A SpatialPointsDataFrame. Must contain a column dates with the start date of the dispersal from each point.

grid

A Raster*. The coordinates will be converted to this grid.

Value

A DataFrame with the converted coordinates.


Coordinates and earliest dates (med cal BP) for European Neolithic sites. Dataset adapted from the supplementary information in Pinhasi et al. 2005 (https://doi.org/10.1371/journal.pbio.0030410).

Description

Coordinates and earliest dates (med cal BP) for European Neolithic sites. Dataset adapted from the supplementary information in Pinhasi et al. 2005 (https://doi.org/10.1371/journal.pbio.0030410).

Usage

euro_dates

Format

A SpatialPointsDataFrame object.


Transformed Net Primary Production (NPP) from 11 ka to 4 ka at 1000 yr steps. Calculated with the Miami formula using paleoclimatic data from Beyer et al. 2020. (https://doi.org/10.1038/s41597-020-0552-1). Clipped to max=1350, squared and scaled to [0,1].

Description

Transformed Net Primary Production (NPP) from 11 ka to 4 ka at 1000 yr steps. Calculated with the Miami formula using paleoclimatic data from Beyer et al. 2020. (https://doi.org/10.1038/s41597-020-0552-1). Clipped to max=1350, squared and scaled to [0,1].

Usage

euro_npp

Format

A RasterStack object.


Reclassified terrain layer with elevation > 1750 m as barriers and rivers and coastline as corridors. Terrain reclassified from SRTM. Rivers rasterized from GSHHG (https://www.soest.hawaii.edu/pwessel/gshhg/) and coastline rasterized from rnaturalearth.

Description

Reclassified terrain layer with elevation > 1750 m as barriers and rivers and coastline as corridors. Terrain reclassified from SRTM. Rivers rasterized from GSHHG (https://www.soest.hawaii.edu/pwessel/gshhg/) and coastline rasterized from rnaturalearth.

Usage

euro_terr

Format

A RasterLayer object.


Coordinates and earliest dates (med cal BP) for Late Pre-Pottery Neolithic B sites in the Near East. Dataset adapted from the supplementary information in Pinhasi et al. 2005 (https://doi.org/10.1371/journal.pbio.0030410).

Description

Coordinates and earliest dates (med cal BP) for Late Pre-Pottery Neolithic B sites in the Near East. Dataset adapted from the supplementary information in Pinhasi et al. 2005 (https://doi.org/10.1371/journal.pbio.0030410).

Usage

ppnb

Format

A DataFrame object.


Simulates first arrival times from one or more origins.

Description

The model uses density-dependent growth and emigration. The carrying capacity, growth rates and mobility are allowed to vary with the environment.

Usage

simulate_dispersal(
  environment,
  terrain,
  coords,
  years,
  r = 0.025,
  phi = 0.5,
  t = 30,
  dist = 50,
  accel = 3,
  gamma = 1,
  updates = NULL,
  verbose = TRUE
)

Arguments

environment

A Raster*. Environmental values that affect carrying capacity and growth rate. Typically given as a fraction (0-1) of the max K. If the environment will be updated during the experiment, this parameter must be a raster stack.

terrain

A Raster*. Cells with value 1 are barriers and cells with value 2 are corridors. If the terrain will be updated during the experiment, this parameter must be a raster stack.

coords

A DataFrame. Must contain columns x, y, and date with the coordinates and starting date (yr BP) of each origin. Coordinates must be in the same system as the environment and terrain layers.

years

Numeric. Number of years to run the model for.

r

Numeric. The annual growth rate as a decimal.

phi

Numeric. The emigration threshold as a fraction of carrying capacity.

t

Numeric. The duration, in years, of a generation (model time step).

dist

Numeric. The distance, in km, that migrants move over a generation.

accel

Numeric. The factor by which the usual distance is increased along corridors. E.g. if dist = 50 km and accel = 3, migrants can move up to 150 km along a corridor. Must range from 2 to 4.

gamma

Numeric. A power that controls the shape of the dependency between r and the environment.

updates

Numeric. Optional vector with the years at which the environment and terrain grids will be updated.

verbose

Boolean. If TRUE, write messages to the console.

Details

The simulation starts with n populated cells at coordinates and start times defined by the parameter coords and runs for a number of time. Each time step corresponds to a generation (defined by parameter t). Growth is applied to every populated cell using a logistic model and emigration to a neighboring cell is calculated from an asymptotic threshold model.

The carrying capacity (K) in the density-dependend growth and emigration models is determined by an environment raster, which normally represents a variable or combination of variables assumed to affect population density (e.g. net primary production, elevation) scaled to 0-1 range.

The dependence of the carrying capacity and growth rate on the environment is allowed to be controlled by a power gamma. By default, the dependence is linear (gamma = 1).

For emigration, a threshold phi is considered, expressed as a fraction of carrying capacity. Migrants are distributed among the available cells of the Moore neighborhood proportionally to the inverse of the distance squared.

Terrain can be represented by a raster specifying barriers (e.g. mountains), which block movement, and corridors (e.g. rivers), which accelerate movement. For the latter, an acceleration factor can be specified.

Value

A RasterLayer with simulated arrival times.

Examples

terr <- raster::stack(replicate(8, euro_terr))
sim <- simulate_dispersal(euro_npp, terr, ppnb, 5500, phi=0.33, updates=seq(10000,4000,-1000))