Supplement 1. Simulation source code (R-script text file) underlying Fig. A5 in the Appendix, and example data set (Rdata file) to run with the code. The example data set is based on bee preferences calculated from different sets of cages, illustrating a "niche shift".
Fruend_Supplement_RSourceCode_SimulationPreferences.r (MD5: 2d88c4b2123f7c3a4282b91084df0f5e)
Fruend_Supplement_ExampleData_forRscript.rdata (MD5: f31ceaf9b2de8520b0acb83114169a32)
Simulation source code (R-script text file) for analyses of preference / niche shifts, used for Figs. 4b and A5 in the article. The code can be run when the .rdata file also provided in this supplement is loaded into R. Simulates visitation data based on bee preferences calculated from different sets of cages, illustrating a ‘niche shift’.
It simulates bee - flower visitation networks based on preferences calculated from cages with 1 and cages with >1 bee species, respectively, and calculates plant species coverage for each simulation. See file for further comments and explanations (marked with # in the R language).
This file provides example data (a subset of the original data) to run with the .r source code. In order to be loaded, it should be in the current working directory of R. It will be automatically loaded by running the code from the script.