R source code for the determination of critical points in the phase transition, the analysis of richness and Shannon diversity of the model, early warnings and the application to Barro Colorado Island fores plot (BCI) .
The neutral-niche model C++ program is available at:
https://dx.doi.org/10.6084/m9.figshare.969692
R Markdown files:
I usually run Rmd files chunk by chunk because there are long simulations, and save ".RData" to keep the results.
Neutral_steadyState.Rmd: Simulations to determine the time to reach steady state
Neutral_simulCT.Rmd: Simulations to find critical values, and plots H vs Rho vs Migration
Neutral_EarlyWarnings_Smax.Rmd: Early warnings of the critical transition based on Maximun Patch
BCIpatchAnalysis.Rmd: Barro Colorado Island analysis you have to obtain the BCI data from http://ctfs.si.edu/webatlas/datasets/bci/Terms%20and%20conditions.htm
R Files
Neutral_fun.r: functions used for the analysis and simulations
BCI_fun.r: functions used for the analysis of BCI data
powerlaw.zip: code to fit powerlaws from http://tuvalu.santafe.edu/~aaronc/powerlaws/ (by Cosma Shalizi)
Data files
.RData are the results of simulations in data.frame format