pleistodist_netmig: Estimate net inter-island migration over time

View source: R/calcmetrics.R

pleistodist_netmigR Documentation

Estimate net inter-island migration over time

Description

This function makes use of the equation from chapter 6 of MacArthur & Wilson (1967) that estimates the number of propagules from a source island arriving at a receiving island as a function of inter-island distance, area, and relative width. Although estimating the unidirectional rate of migration from one island to another requires several other coefficients (alpha: the coefficient of population density, and lambda: the coefficient of overwater dispersal), calculating the ratio of migration rate for bidirectional migration causes these coefficients to cancel out, allowing for net migration rate to be estimated using purely geomorphological and distance-based metrics. The net migration rate can therefore be calculated using the equation (atan(t2/(2*d))A1)/(atan(t1/(2d))*A2), where t is the island width relative to the other island, d is the inter-island distance, and A is the island area, for islands 1 and 2. If the net migration rate is greater than 1, then the net movement of propagules occurs from island 1 to island 2. If the net migration rate is less than 1, then the net movement of propagules occurs from island 2 to island 1.

Usage

pleistodist_netmig(points, epsg, disttype, intervalfile, mapdir, outdir)

Arguments

points

A user-generated multi-point shapefile (.shp) containing at least two points. If the shapefile attribute table contains a column labelled 'Name', the output distance matrix will use the identifiers in this column to label each pairwise comparison. Otherwise, the output distance matrix will use the attribute FID values instead.

epsg

The projected coordinate system in EPSG code format. Because of the curvature of the Earth's surface, we need to apply a map projection to accurately calculate straight-line distances between points instead of using the default WGS84 geographical coordinate system. Users should specify a projected coordinate system appropriate to the geographic region being analysed using the projection's associated EPSG code (https://epsg.org/home). Geographic coordinate system projections are not recommended as those will result in distance matrices calculated in decimal degrees rather than in distance units.

disttype

The type of inter-island distance matrix to use for this calculation, either "centroid", "leastshore", or "meanshore".

intervalfile

This is the master control file generated using either the getintervals_time() or getintervals_sealvl() function that defines the number of intervals, the sea level at each interval, and the duration of each interval. By default, this function will use the "intervals.csv" file stored in the output folder, but users can also specify their own custom interval file (with nice round mean sea level values, for example), although users need to ensure that the same column names are preserved, and be aware that custom interval files may lead to inaccurate weighted mean calculations.

mapdir

The directory containing map outputs from the makemaps() function (i.e. the directory containing the raster_flat, raster_topo, and shapefile folders).

outdir

The directory containing inter-island distance, island area, and relative island width matrices, either generated by other PleistoDist functions, or generated de novo by this function if these files don't already exist. All pleistodist_netmig() outputs will also be written to this folder.

Value

This function outputs a matrix of island surface area estimates in long format, with one column per interval.

Examples


#create temp directory
path <- file.path(tempdir())
#create points shapefile
points <- sf::st_multipoint(rbind(c(179.41256,-17.79426), c(179.27600,-17.97850)))
#convert points to feature geometry
points <- sf::st_sfc(points)
points <- sf::st_cast(points, "POINT")
#set default projection (WGS84)
sf::st_crs(points) <- 4326
#save shapefile
sf::write_sf(points,paste0(path,"/points.shp"))
#load bathymetry file
fiji <- system.file("extdata","FJ.asc",package="PleistoDist")
#generate interval file for 2 intervals and 20 kya cutoff time, binning by time
getintervals_time(time=20,intervals=2,outdir=path)
#generate maps based on interval file, projecting map using EPSG:3141
makemaps(inputraster=fiji,epsg=3141,intervalfile=paste0(path,"/intervals.csv"),outdir=path)
#calculate net migration, for centroid-to-centroid distances, projecting points using EPSG:3141
pleistodist_netmig(points=paste0(path,"/points.shp"),epsg=3141,disttype="centroid",
    intervalfile=paste0(path,"/intervals.csv"),mapdir=path,outdir=path)


g33k5p34k/PleistoDistR documentation built on Oct. 9, 2022, 5:27 a.m.