Published February 4, 2018 | Version v2

Appendix S2, manuscript: Distinguishing the signatures of local environmental filtering and regional trait range limits in the study of trait-environment relationships

  • 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 three 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).

The third section is dedicated to the plots of the results obtained.

 

Files

Files (10.6 kB)

Name Size
md5:ea54731b2743c7178370fdee344bdb50
10.6 kB Download