Code from: A theoretical framework for trait-based eco-evolutionary dynamics: population structure, intraspecific variation, and community assembly
Abstract
How is trait diversity in a community apportioned between and within co-evolving species? Disruptive selection may result in either a few species with large intraspecific trait variation (ITV) or many species with different mean traits but little ITV. Similar questions arise in spatially structured communities: heterogeneous environments could result in either a few species that exhibit local adaptation or many species with different mean traits but little local adaptation. To date, theory has been well-equipped to either include ITV or to dynamically determine the number of coexisting species, but not both. Here, we devise a theoretical framework that combines these facets, and apply it to the above questions of how trait variation is apportioned within and between species in unstructured and structured populations, using two simple models of Lotka-Volterra competition. For unstructured communities, we find that as the breadth of the resource spectrum increases, ITV goes from being unimportant to crucial for characterizing the community. For spatially structured communities on two patches, we find no local adaptation, symmetric local adaptation, or asymmetric local adaptation depending on how much the patches differ. Our framework provides a general approach to incorporate ITV in models of eco-evolutionary community assembly.
Usage notes
This repository contains the code for generating the data and producing the figures in the manuscript "A theoretical framework for trait-based eco-evolutionary dynamics: population structure, intraspecific variation, and community assembly". The code is supplied for the purpose of verifying the results we present in the manuscript. All code is written in Julia, which is freely available from https://julialang.org/. See the readme for details.
The root folder contains the following user-facing script files:
File | Description |
install_packages.jl | Installs the necessary Julia packages for running the simulations |
make_figure_1.jl | Generates and plots the data for Fig. 1 in the paper |
make_figure_2.jl | Generates and plots the data for Fig. 2 in the paper |
make_figure_3.jl | Generates and plots the data for Fig. 3 in the paper |
make_figure_S1.jl | Generates and plots the data for Fig. S1 in the online supplement for the paper |
make_figure_S3.jl | Generates and plots the data for Fig. S3 in the online supplement for the paper |
make_figure_S4.jl | Generates and plots the data for Fig. S4 in the online supplement for the paper |