flex.competition: perform flexible competition analysis allowing multiple...

Description Usage Arguments Author(s) References See Also Examples

View source: R/coexist.R

Description

this function is used to characterize species' competition (i.e., species population gain/loss due to competition) across the patches for each time step for multiple-species modeling

Usage

1
flex.competition(spvector, resource, grow, comp, allee = 1)

Arguments

spvector

species-patch abundance matrix prior to dispersal in this time step

resource

carrying capability of the species at each patches, thus it is a matrix in terms of species-patches

grow

growth rate matrix for all species (rows) across patches (columns)

comp

competition coefficient matrix for the species (rows) across patches (columns)

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

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

competition, compvar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##---- 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, resource, grow, comp, allee = 1) 
{
    spnum <- dim(spvector)[1]
    islandnum <- dim(spvector)[2]
    for (i in 1:islandnum) {
        s <- spvector[, i]
        for (sp in 1:spnum) {
            spvector[sp, i] = s[sp] + (1 - comp[sp, i] * s[sp]/resource[sp, 
                i] - (1 - comp[sp, i]) * sum(s[-sp])/resource[sp, 
                i]) * s[sp] * grow[sp, i]
            if (spvector[sp, i] < allee) {
                spvector[sp, i] = 0
            }
        }
    }
    return(spvector)
  }

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