-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Our goal is to test for distance decay in structure between insular communities using spatial modularity and disentangle the factors that generate this pattern. In multilayer networks, a module can span several local communities. Therefore, distance decay in structure is a pattern in which the farther apart two local communities are, the less they share modules. We use data from local plant-pollinator networks in the Canary Islands, which we represent as a spatial multilayer network. This data set is particularly suitable because a previous study suggests signs of distance decay in species and interactions between islands in this system. Distance decay in species composition should strongly affect spatial modularity because if two islands are remote and do not share species, they are unlikely to share modules. We hypothesized that species turnover (
- R- All used code.
- csvs_nuevo- Every notable output saved as a csv.
- graphs- Every graph created as a part of this project.
- Extra_analysis- Previous analysis not used in the main manuscript.
This portion of the code contains functions used in more than one analysis.
- The functions are organized by their main goal.
- Before every function there is an explanation of the intention of the function or what it calculates.
This code turns the data into a multilayer network with 5 layers (islands as layers) and tests distance decay in module composition of the empirical network.
- Gets an interactions csv organized by Noa Fridman based on the interactions recorded and documented in the original research. Also gets a csv of the distance between islands (layers).
- Creates interlayer and intralayer edges data and normalizes the weights between 0 and 1.
- Interlayers and intralayers edges, nodes, and layers are combined into a multilayer network.
- Modularity analysis is conducted. It also contains basic exploratory analysis regarding modules such as the number of shared modules between islands.
- Tests distance decay in module composition in the empirical network.
This portion of the code runs the null model M1, in which we shuffled species between islands (layers) in one of 3 versions:
- shuffling plants among themselves
- shuffling pollinators among themselves
- shuffling plants among themselves and then pollinators among themselves
The shuffled networks are then compared to the empirical network to determine whether species turnover is influencing the pattern found.
This portion of the code runs the null model M2, in which we shuffled interactions between islands (layers).
- We randomly shuffled interactions of each pair of species between all the layers in which they co-occur. For example, if a plant and a pollinator co-occurred in layers 1 and 3 but interacted only in layer 1, they would still co-occur in the same layers but may interact in layer 3 after shuffling.
The shuffled networks are then compared to the empirical network to determine whether interaction rewiring is influencing the pattern found.
This portion of the code runs the null model M3, in which we shuffled interactions within islands (layers).
The shuffled networks are then compared to the empirical network to determine whether local factors influence the pattern found.