Description Usage Arguments Author(s) References See Also Examples
View source: R/coexist.R View source: R/coexist.R
Analyze and compare the number of patches that have allowed the coexistence of both species for each of the sampling points of the single focused parameter (while partialling out the influence of other parameters by taking average).
1 | sta.comparison(coexistence, parameters,island)
|
coexistence |
the basic statistics generated from sta.coexistence() function |
parameters |
a parameter sampling point vector,for example parameters=c(.2,.5,.9), indicating three sampling points in a single parameter. The function will thus compare the number of patches where coexistence emerged (coexisting species number>=2) under the cases when the parameter (for example, growth rate for species 1)=0.2,0.5 and 0.9 respectively. |
island |
number of patches in the model |
Youhua Chen <yhchen@zoology.ubc.ca>
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.
sta.mcomparison
,
sta.coexistence
,
batch.coexistence
,
batch.onepar
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 | ##---- 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, parameters,island)
{
comparisonlist <- list()
length(comparisonlist) <- dim(coexistence)[2] - 3
conum <- matrix(0, ncol = length(parameters) + 1, nrow = island)
for (pars in 1:length(comparisonlist)) {
for (i in 1:(island - 1)) {
conum[i, 1] = island - i
for (j in 1:length(parameters)) {
conum[i, j + 1] <- length(which(coexistence[,
3] == island - i & coexistence[, pars + 3] ==
parameters[j]))
}
}
for (j in 1:length(parameters)) {
conum[island, j + 1] = length(which(coexistence[,
pars + 3] == parameters[j]))
}
comparisonlist[[pars]] <- conum
}
names(comparisonlist) <- colnames(coexistence[, 4:dim(coexistence)[2]])
return(comparisonlist)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.