View source: R/limiting_similarity_filtering.R
similarity_filtering | R Documentation |
Limiting similarity filtering assembly
similarity_filtering( sp.names, metaweb, t = 0, method = "jaccard", stat = "mean", mode = "all", max.iter = 1000, output.verbose = FALSE )
sp.names |
vector, names of the species in the meta-community. |
metaweb |
adjacency matrix of the meta food web (metaweb). |
t |
is the 'temperature' of the system. |
method |
character, same as in similarity (igraph). Options are 'jaccard', 'dice', and 'invlogweighted'. |
stat |
character, statistic used to summarize similarity. Currently available are c("mean", "sum", "max"). |
mode |
character, which edges are used to compute similarity. Currently available are c("all", "in", "out"). |
max.iter |
is the maximum number of moves computed. |
output.verbose |
logical, if to return also: 1) the average for species' trophic niches, defined as mean and variance of the trophic level of their resources. 2) the similiarity score. If output.verbose == TRUE, these are returned for each assembly move. Note that this will slow down computations significantly. |
Similarities are calculated using igraph as matrices. To summarize these into species-level metrics, the argument "stat" is needed. When stat = "mean", probability of removal of species is proportional to the average of their similarities, etc. Global similarities, i.e. of the whole food web, are also summarized depending on the "stat" argument in a similar way.
When mode = 'in', similarity is computed using only 'in' links, i.e. species are considered similar if they share similar resources, but not necessarily have similar consumers. The opposite is treu when mode = 'out'. When mode = 'all' (default) all edges are considered.
The temperature parameter 't' specifies the degree of stochasticity of the algorithm. For t > 0, an unfavourable move can be accepted, if it passes a probabilistic acceptance criterion. For t = 0, stochasticity is removed and the algorithm becomes purely deterministic. This may be result in some unwarranted behavior, e.g. strongly modular food webs.
A vector with the species names.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.