Learn R Programming

coexist (version 1.0)

dispersal: perform dispersal analysis for each simulation time step for 2-species modeling

Description

this function is used to characterize species' dispersal across the patches for each time step

Usage

dispersal(spvector, initp,dismat, allee = 1)

Arguments

spvector
species-patch abundance matrix prior to dispersal in this time step
initp
initial population size for a species that will be released at the source patch at each time step
dismat
a dispersal matrix, or connectivity matrix among the patches (i.e., matrix is the same for all species). Different from flex.dispersal() function, which is a list of matrices, and allowed different species will have different dispersal rates across patches
allee
allee effect for the species, the minimum viable population in a local patch, default=1, indicating that if the population size in a patch for a species is less than 1, then the species will be removed from that patch

Details

return an updated species-patch abundance matrix at next time step

References

Chen YH (2012) coexist: an R package for performing species coexistence modeling and analysis under asymmetric dispersal and fluctuating source-sink dynamics. http://code.google.com/p/coexist.

See Also

flex.dispersal, competition

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (spvector, initp, dismat, allee = 1) 
{
    spvector <- spvector %*% dismat
    spvector[1, 1] = initp
    spvector[2, 1] = initp
    spvector[which(spvector < allee)] = 0
    return(spvector)
  }

Run the code above in your browser using DataLab