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".

<h2>File List</h2><div> <p><a href="Fruend_Supplement_RSourceCode_SimulationPreferences.r">Fruend_Supplement_RSourceCode_SimulationPreferences.r</a> (MD5: 2d88c4b2123f7c3a4282b91084df0f5e)</p> <p><a href="Fruend_Supplement_ExampleData_forRscript.rdata">Fruend_Supplement_ExampleData_forRscript.rdata</a> (MD5: f31ceaf9b2de8520b0acb83114169a32)</p> </div><h2>Description</h2><div> <p>Fruend_Supplement_RSourceCode_SimulationPreferences.r</p> <p>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’.</p> <p>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).</p> <p>Fruend_Supplement_ExampleData_forRscript.rdata</p> <p>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.</p> </div>