flex.dispersal: perform species-specific dispersal and fluctuating source...

Description Usage Arguments Author(s) References See Also Examples

View source: R/coexist.R

Description

perform species-specific dispersal and fluctuating source analysis, for two or multiple species models, it's an internal function

Usage

1
flex.dispersal(spvector, initp,dismat, allee = 1,type = "constant")

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 list of dispersal matrix for each of the species. The dispersal matrix for the species indicated its dispersal ability and perference across the 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

type

model configuration for the source supply methods, currently there are three types of source species supplying modes: "constant": constant population size of each species will be released at the source patch for each simulation step "flexible": random population size of each species will be released (all species should typically be assigned different values) based on a normal distribution with mean=initp, Variance=initp/2, at the source patch for each simulation step "cochange": random population size (but all species will be assigned a same value) at the source patch for each simulation step

Author(s)

Youhua Chen <yhchen@zoology.ubc.ca>

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.competition, dispersal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##---- 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, type = "constant") 
{
    if (type == "constant") {
        spnum <- length(dismat)
        for (i in 1:spnum) {
            spvector[i, ] <- spvector[i, ] %*% dismat[[i]]
            spvector[i, 1] = initp
        }
    }
    if (type == "flexible") {
        spnum <- length(dismat)
        for (i in 1:spnum) {
            spvector[i, ] <- spvector[i, ] %*% dismat[[i]]
            spvector[i, 1] = rnorm(1, mean = initp, sd = initp/10)
        }
    }
    if (type == "cochange") {
        spnum <- length(dismat)
        newresource <- rnorm(1, mean = initp, sd = initp/10)
        for (i in 1:spnum) {
            spvector[i, ] <- spvector[i, ] %*% dismat[[i]]
            spvector[i, 1] = newresource
        }
    }
    spvector[which(spvector < allee)] = 0
    spvector[which(spvector < 0)] = 0
    return(spvector)
  }

coexist documentation built on May 2, 2019, 1:43 p.m.