sta.fitness: fitness/abundance comparison for neutral versus niche cases...

Description Usage Arguments Author(s) References Examples

View source: R/coexist.R

Description

using the output form sta.coexistence(), then divide the cases into two groups, one of which has the feature that both species have equal growth rates (neutrality or nearly-neutrality cases); and another group with unequal growth rates (niche cases). Then, the function checks the patch number where both species can coexist under each of the conflicting models (neutrality versus niche). For example, there are 5 patches in the simulation, under neutrality group, assuming we have 2000 parameter combination cases. Among the parameter combinations, 100 of which allowed both species coexist in all 5 patches, 300 of which allowed species coexist in 3 of 5 patches. Then, the data will be recorded as two rows. Output is a matrix, row number=patch number

Usage

1
sta.fitness(coexistence,island)

Arguments

coexistence

using the output form sta.coexistence() function

island

number of patches in the modeling

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.

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
##---- 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 (coexistence) 
{
    neutral <- coexistence[which(coexistence[, 4] == coexistence[, 
        5]), ]
    niche <- coexistence[which(coexistence[, 4] != coexistence[, 
        5]), ]
    neutral.num <- dim(neutral)[1]
    niche.num <- dim(niche)[1]
    conum <- matrix(0, ncol = 2, nrow = island)
    colnames(conum) <- c("neutral", "niche")
    for (i in 1:(island - 1)) {
        conum[i, 1] <- length(which(neutral[, 3] == island - 
            i))
        conum[i, 2] <- length(which(niche[, 3] == island - i))
    }
    conum[island, 1] = neutral.num
    conum[island, 2] = niche.num
    return(conum)
  }

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