DOI: 10.5061/dryad.m7b43mm
title: Data from: The coevolution of lifespan and reversible plasticity

description: Reversible phenotypic plasticity, the ability to change one’s phenotype
 repeatedly throughout life, can be selected for in environments that do
 not stay constant throughout an individual’s lifetime. It might also
 mitigate senescence, as the mismatch between the varying environment and a
 non-plastic individual’s traits is likely to increase as time passes. To
 understand why reversible plasticity may covary with lifespan, studies
 tend to assume unidirectional causality: plasticity evolves under suitable
 rates of environmental variation with respect to life history. Here we
 show that if lifespan also evolves in response to plasticity, then long
 life is not merely a context that sets the stage for lifelong plasticity.
 Instead, the causality is bidirectional because plasticity itself can
 select for longevity. Highly autocorrelated environmental fluctuations
 predict low investment in reversible plasticity and a phenotype that is
 poorly matched to the environment at older ages. Such environments select
 for high reproductive effort and short lifespans.
description: Simulation code for
 evolution of plasticity and reproductive investmentThis is the main matlab
 code for a function that can be used to simulate the coevolution of
 reversible plasticity and reproductive investment. Please see paper for
 full explanation and justification of simulation. Requires
 ddist.mevomemory.mMatlab function to draw number of offspringThis is the function required to run evomemory.m simulation function. With this function you can sample n individuals from a discrete distribution given in p.ddists.mMatlab code to run the function evomemory.m for a range of parameters and save resulting dataThis is the code for running the evomemory.m function to simulate data for a range of parameter values and save the data that has been generated.lifeplast.mR code to generate figures as presented in paperThis R code generates all the figures presented in Ratikainen&Kokko 2019 both for the main paper and the supplementary material. The code imports the data simulated with the matlab code lifeplast.m, evomemory.m and ddists.m. Make sure data files are in the same folder as R code file.CodeForFigures.RSimulated data illustrating the coevolution of lifespan and reversible plasticityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for baseline parameter values. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplast.matSimulated data for coevolution of lifespan and reversible plasticity with low cost of plasticityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for low costs of updating (kappa=0.2), baseline parameter values otherwise. These results are described in Supplementary note 1 and illustrated in Supplementary figure 4. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastCS02.matSimulated data for coevolution of lifespan and reversible plasticity with high cost of plasticityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for high costs of updating (kappa=0.6), baseline parameter values otherwise. These results are described in Supplementary note 1 and illustrated in Supplementary figure 5. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastCS06.matSimulated data for coevolution of lifespan and reversible plasticity with high cost of reproductionThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for high costs of reproduction (rho=0.05), baseline parameter values otherwise. These results are described in Supplementary note 2 and illustrated in Supplementary figure 6. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastCR005.matSimulated data for coevolution of lifespan and reversible plasticity when phenotypic mismatch affect only mortalityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where phenotypic mismatch with the environment affect only adult mortality but not reproductive success, baseline parameter values otherwise. These results are described in Supplementary note 3 and illustrated in Supplementary figure 7. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastMismatchAffectMortalityOnly.matSimulated data for coevolution of lifespan and reversible plasticity when phenotypic mismatch affect only fecundityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where phenotypic mismatch with the environment affect only reproductive success but not adult mortality, baseline parameter values otherwise. These results are described in Supplementary note 4 and illustrated in Supplementary figure 8. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastMismatchAffectFecundityOnly.matSimulated data for coevolution of lifespan and reversible plasticity when environment varies according to ARMA modelThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description), baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 9. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastARMA.matSimulated data for coevolution of lifespan and reversible plasticity with ARMA modeled environment and low cost of plasticityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description). In addition, cost of updating is lower than baseline (kappa=0.2) baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 11. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastARMALowCost.matSimulated data for coevolution of lifespan and reversible plasticity with ARMA modeled environment and high cost of plasticityThis datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description). In addition, cost of updating is higher than baseline (kappa=0.6) baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 10. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.lifeplastARMAHighCost.mat