Appendix S2, manuscript: How to distinguish the signatures of environmental filtering and trait range limits in trait-gradient analyses?
Authors/Creators
- 1. CEFE, CNRS, FRANCE
- 2. Université Grenoble-Alpes, LECA, FRANCE
Description
Appendix S2. R code to simulate and analyze communities.
This example is divided into two parts. The first part simulates communities using the R package ecolottery (F. Munoz, et al. ecolottery, (2017), https://cran.r-project.org/web/packages/ecolottery/index.html). In the example of the paper, the parameters used to build communities are the following: species pool with 100.000 individuals belonging to 100 species with equal abundances (i.e., 1000 individuals each), and species trait values drawn from a uniform distribution between a=0 and b=1. Each community includes 500 individuals and the immigrants establishing in communities are drawn from the species pool. Stabilizing environmental filtering determines establishment probability of immigrants depending on the departure of their trait value t from a local optimum topt. We thus choose a Gaussian filtering function of mean topt, which varies among communities, and standard deviation σopt equal to 0.25. The data frame of simulated communities is called simulation. The community-weighted mean (CWM) and variance (CWV) are calculated for each community.
The second section estimates the two parameters topt and σopt in each community, by comparing observed summary statistics of the community to summary statistics simulated over a broad range of topt and σopt values, with approximate Bayesian computation (ABC) analysis (coalesc_abc function; Munoz et al., 2017).
Files
Files
(5.1 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:e1dfb9196743580b55eb2d003ffd4282
|
5.1 kB | Download |