DOI: 10.5061/dryad.w9ghx3fxh
title: Data from: Asynchronous life histories generate uneven arms races and impact the maintenance of mutualisms

description: Mutualisms constitute a diverse class of ecologically important
 interactions, yet their ecological and evolutionary stability remain
 topics of debate in coevolutionary theory. Recent theoretical and
 empirical work has suggested that coevolutionary arms races may be
 involved in the maintenance of mutualistic interactions, sustaining
 mutually beneficial outcomes for interacting species while producing
 exaggerated traits. Here we present an individual-based model that
 evaluates how asynchronous life histories – i.e., partners with different
 average lifespans – change the dynamics of trait coevolution, the expected
 fitness outcomes for species involved, and the dynamics of selection
 differentials across time for each species. Results indicate that a
 longer-lived mutualist will consistently ‘lose’ an otherwise balanced
 coevolutionary arms race, being outpaced in both the mean trait value and
 fitness outcome compared to a shorter-lived partner. Furthermore, linear
 selection differentials on mutualistic traits become increasingly
 divergent as life histories become increasingly asynchronous, with the
 longer-lived species experiencing persistent directional selection and the
 shorter-lived species experiencing weaker, more inconsistent selection.
 These results suggest that asynchronous life histories can complicate the
 maintenance of mutualistic interactions via coevolutionary arms-races and
 that detecting coevolution via selection differentials may be difficult
 when life histories are sufficiently divergent.
description: This data was simulated using the included scripts. All
 processing is done by the scripts themselves. A README.md file is included
 to describe how the data and scripts should be used.
description: # Asynchronous life histories generate uneven arms races and impact the
 maintenance of mutualisms Authors: Aaron Westmoreland & Nancy Emery
 Summary: This study evaluates how asyncrhonous life histories affect the
 pace and outcomes of mutualistic coevolutionary arms races. In particular,
 it looks at how disparities in longevity and generation time (i.e., when
 one species is longer lived than its partner and thus generations do not
 align cleanly) affects the rates of evolutionary change in each species,
 the benefits each species gains from the interactions, and the behavior of
 the selection differential in each species. We find that as the disparity
 between life histories is increased, arms races become increasingly uneven
 with the longer-lived species experiencing stronger selection while
 gaining decreased benefits compared to its partner. We discuss these
 results in the context of the long-term maintenance of mutualistic
 interactions, the Red Queen vs Red King Hypotheses for mutualisms, and the
 empirical detection of coevolution. Corresponding Author Contact:
 [aaron.westmoreland@colorado.edu](mailto:aaron.westmoreland@colorado.edu)
 This directory contains three sets of scripts: 1) the R source script for
 the asynchronous generations model (Asynch_generation_function.R), 2) R
 scripts for specific parameterizations of the asynchronous generations
 model (Matched_mort for matched mortalities, Ten_percent_mort for ten
 percent mortality, etc.) and 3) R scripts for processing simulation output
 and generating summary plots (Mortality_data_processing.R). The repository
 also contains two data files for reproducing figures without re-running
 the entire simulations, which are quite time consuming. That being said,
 because of file size limitations on github, these are only the summaries
 used in the processing script rather than the entire record from each
 simulation. Similarly, one of the two files contains only the columns
 necessary for plotting and is zipped to fall within size limits. So long
 as the working directory is set to the location of these files, the
 scripts should run without issue. Be sure to check at the top of the
 Mortality_data_processing.R for the lines to start if you are not
 re-running entire simulations. Order of scripts: 1.
 Asynch_generation_function.R - This needs to be run for any and all
 simulations you want to run. It is also sourced at the top of each
 parameterization-specific file, but if you are running simulations
 locally/manually be sure this file has been run first. No outputs - just
 generates necessary functions for simulation. These should be available in
 the working environment in R after this script is run. 2. Specific
 parameterizations - if you are generating your own outputs, these will
 write RDS files which are used by Mortality_data_processing.R. Outputs:
 Two .rds files for each parameterization - one with age structure one with
 averages over all age structures. Only the no_age.rds files are used in
 later steps. 3. Mortality_data_processing.R - This can be run on its own
 with the included rds/csv files and will produce the plots presented in
 the manuscript. If you are running your own simulations, this should be
 the last script run, as it relies on the output from each parameterization
 file, which themselves rely on the Asynch_generation_function.R script.
 Outputs: Eight .png files for plots from manuscript. Alternatively, can be
 run interactively in R to view plots without writing them to disk. These
 scripts were intended to run on an HPC and require small changes to run on
 a local laptop or PC. In particular, all scripts for specific
 parameterizations should have their working directory paths changed to the
 directory the source script is in and should be edited to ensure they run
 on sufficient cores and with enough replicates. As written, they have one
 replicate per core. Setting the working directory can be done at the top
 of each script. You can change the number of cores (and thus the number of
 simulations running in parallel) around lines 38-40 of each script - using
 the mc.cores argument of mclapply. You can also run more simulations than
 you have cores (thus not running them all in parallel) by changing the
 nsims and mc.cores arguments separately. Scripts for these specific
 parameterizations will output .rds files with the summary tables for all
 simulations. The Mortality_data_processing scripts read in the no_age .rds
 files and generate results plots. Plots are only produced for summaries
 without age structure. Age structured summaries do not show unique
 patterns when compared to the pooled summaries. R Version: 4.3.3
 Libraries: dplyr - 1.1.4 ggplot2 - 3.5.0 ggnewscale - 0.4.1 parallel -
 4.3.3 (part of base R) readr - 2.1.5 Data files included:
 \#Number#_percent_mortality.rds/csv - these contain the results of
 simulations for a given paramterization. Both csv and rds files contain
 the same data but csv files can be more easily analysed with tools outside
 of R, so we include both. Both work directly in the
 Mortality_data_processing.R and reproduce all plots from Figures 3 and 4
 in the manuscript. Note that the plant species in all variables is species
 L (the longer-lived species) from the manuscript, while the pollinator
 species is species S (the shorter-lived species.) Column names for each
 rds/csv: "plants.generation" - current time step for a given row
 "plants.trait_means" - mean trait value of plants at current
 timestep "plants.trait_sd" - standard deviation of trait value
 in plants at current timestep "plants.int_means" - mean fitness
 value in plants at current timestep "plants.int_sd" - standard
 deviation of fitness value in plants at current timestep
 "plants.rel_fit_mean" - mean relative fitness in plants at
 current timestep (always 1) "plants.rel_fit_sd" - standard
 deviation of relative fitness in plnats at current timestep
 "plants.sd_ratio" - ratio of standard deviations in relative
 fitness plants:pollinators - meant to measure degree to which variation in
 relative fitness is equal or unequal between mutualists
 "plants.pop_size" - population size of plants at current
 timestep - should always be 3000 "plants.fit_corr" - correlation
 between trait value and absolute fitness and trait value in plants at
 current timestep "plants.rel_fit_corr" - correlation between
 trait value and relative fitness and trait value in plants at current
 timestep "plants.sel_differential" - slope from linear model
 relating absolute fitness to trait value in plants - not a proper metric
 of the selection differential though "plants.non_rel_sel_diff" -
 slope from linear model relating relative fitness to trait value in plants
 - proper selection differential, reported in manuscript
 "polls.generation" - current time step for a given row
 "polls.trait_means" - mean trait value of pollinators at current
 timestep\ "polls.trait_sd" - standard deviation of trait value
 in pollinators at current timestep\ "polls.int_means" - mean
 fitness value in pollinators at current timestep "polls.int_sd"
 - standard deviation of fitness value in pollinators at current timestep
 "polls.rel_fit_mean" - mean relative fitness in pollinators at
 current timestep (always 1) "polls.rel_fit_sd" - standard
 deviation of relative fitness in pollinators at current timestep
 "polls.sd_ratio" - ratio of standard deviations in relative
 fitness pollinators:plants - meant to measure degree to which variation in
 relative fitness is equal or unequal between mutualists\
 "polls.pop_size" population size of pollinators at current
 timestep - should always be 3000 "polls.fit_corr" - correlation
 between trait value and absolute fitness and trait value in pollinators at
 current timestep "polls.rel_fit_corr" - correlation between
 trait value and relative fitness and trait value in pollinators at current
 timestep "polls.sel_differential" - slope from linear model
 relating absolute fitness to trait value in plants - not a proper metric
 of the selection differential though "polls.non_rel_sel_diff" -
 slope from linear model relating relative fitness to trait value in plants
 - proper selection differential, reported in manuscript
 "demo_change" - number of deaths in plant at current timestep\
 "plant_slope" - slope of plant trait over whole simulation -
 repeated for each iteration\ "poll_slope" - slope of pollinator
 trait over whole simulation - repeated for each iteration
 "iteration" - tracks replication for each parameterization -
 should number 1:64 in the current data since 64 simulations were run for
 each parameterization - repeated for each iteration "Mort" -
 mortality rate in plant species - always between 0.1 and 1 - repeated for
 each iteration