set_mig: Create migration matrices.

View source: R/Parameter_functions.R

set_migR Documentation

Create migration matrices.

Description

Function to create list of migration matrices.

Usage

set_mig(paramfile, site.arrange, max.dist, tot)

Arguments

paramfile

params object initialized using make_params.

site.arrange

Matrix or Distance object. Either a two column matrix with x-values \(i.e. longitude\) in the first column and y-values (i.e. latitude) in the second column or a pairwise distance object between each site.

max.dist

Numeric vector containing the maximum distance species can migrate.

tot

Numeric vector containing values between 0 and 1 of the probability for a species to migrate.

Details

The parameters max.dist and tot can be either single values or vectors. If a single value the code assumes that each species has the same migration matrix, if a vector, it creates separate migration matrices for each species according to the inputed parameters. Species specific parameters for max.dist and tot must be in the same order as in the metacommunity matrix.

Value

Returns a list of numeric migration matrices.

See Also

make_mig

Examples

paramfile <- make_params(5,5)

# Make random landscape with 5 sites
xy <- matrix(sample(50, 10), ncol = 2)

## Where all species have the same migration matrix ##

paramfile$mig <- set_mig(paramfile, xy, 10, .1)

## Where each species has own migration matrix

paramfile$mig <- set_mig(paramfile, xy, c(10, 9, 15, 2, 11), c(.1, .2, .05, .1, .15))


trevorjwilli/CommSimABCR documentation built on Feb. 4, 2025, 1:22 a.m.