Description
This submission contains all the code and data necessary for reproducing 1) the dataset, 2) the main results, and 3) all supplemental analyses appearing in the manuscript titled: Plasticity and not adaptation is the primary source of temperature-mediated variation in flowering phenology in North America (Ramirez-Parada, Park, Record, Davis, Ellison, and Mazer, 2023). A preprint of this manuscript can be accessed at: https://doi.org/10.21203/rs.3.rs-3131821/v1.
Extracting the compressed file will generate a folder titled "Project folder", containing sub-folders named "Data" and "R code". In order for the code to work, users need to preserve the folder structure of the code and data, as the R Markdown files in the "R code" folder have relative file paths that read and write data within the "Data" folder. Moving either would require re-writing the filepaths across Rmds for the code to run.
To replicate the results, the following R Markdowns must be run in sequence (once they have been run, the Rmds for supplemental analyses can be used in any order):
"1. Subsetting Dataset.Rmd"
This file processes a specimen dataset of ca. 2.3 million specimens that we assembled for this project (publicly available on Dryad: https://doi.org/10.25349/D9WP6S), filtering out duplicates, specimens out of the spatial scope of the PRISM data used for all analyses, and subsetting to only those species represented by a minimum of 300 specimens. This filtering yields a dataset of 1,038,047 specimens in flower across 1,605 species.
For an in-depth description of the starting dataset, please refer to the "READ ME.txt" file within the "Project folder", and visit its corresponding Dryad repository (linked above).
"2. Main Analysis - Estimating S_space, S_time, and S_diff.Rmd"
This file uses the subset dataset produced by the previous Rmd to fit the varying-intercepts, varying-slopes model that produced the estimates of apparent plasticity and apparent adaptation underlying all main analyses. This Rmd exports a dataset of species-specific estimates of Sspace, Stime, and Sspace - Stime that is used to recreate Figures 2, 3, and 4 of the main text in the next step. This is the most time consuming R Markdown file to run, as each MCMC chain used to fit the model in Stan must be run on a dedicated processor (limiting the usefulness of parallel computation). Fitting the model using 3 MCMC chains, 1000 iterations for warmup, and 4000 iterations for sampling, took approximately 24 hours using an Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz processor.
"3. Main Analysis - Figures 2, 3, and 4.Rmd"
Finally, this Rmd uses the dataset of species-specific estimates to conduct all analyses underlying Figures 2, 3, and 4, recreating each of these figures.
For detailed descriptions of all materials (code and data) and instructions for using them, please refer to the "READ ME.txt" file within "Project folder".
Extracting the compressed file will generate a folder titled "Project folder", containing sub-folders named "Data" and "R code". In order for the code to work, users need to preserve the folder structure of the code and data, as the R Markdown files in the "R code" folder have relative file paths that read and write data within the "Data" folder. Moving either would require re-writing the filepaths across Rmds for the code to run.
To replicate the results, the following R Markdowns must be run in sequence (once they have been run, the Rmds for supplemental analyses can be used in any order):
"1. Subsetting Dataset.Rmd"
This file processes a specimen dataset of ca. 2.3 million specimens that we assembled for this project (publicly available on Dryad: https://doi.org/10.25349/D9WP6S), filtering out duplicates, specimens out of the spatial scope of the PRISM data used for all analyses, and subsetting to only those species represented by a minimum of 300 specimens. This filtering yields a dataset of 1,038,047 specimens in flower across 1,605 species.
For an in-depth description of the starting dataset, please refer to the "READ ME.txt" file within the "Project folder", and visit its corresponding Dryad repository (linked above).
"2. Main Analysis - Estimating S_space, S_time, and S_diff.Rmd"
This file uses the subset dataset produced by the previous Rmd to fit the varying-intercepts, varying-slopes model that produced the estimates of apparent plasticity and apparent adaptation underlying all main analyses. This Rmd exports a dataset of species-specific estimates of Sspace, Stime, and Sspace - Stime that is used to recreate Figures 2, 3, and 4 of the main text in the next step. This is the most time consuming R Markdown file to run, as each MCMC chain used to fit the model in Stan must be run on a dedicated processor (limiting the usefulness of parallel computation). Fitting the model using 3 MCMC chains, 1000 iterations for warmup, and 4000 iterations for sampling, took approximately 24 hours using an Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz processor.
"3. Main Analysis - Figures 2, 3, and 4.Rmd"
Finally, this Rmd uses the dataset of species-specific estimates to conduct all analyses underlying Figures 2, 3, and 4, recreating each of these figures.
For detailed descriptions of all materials (code and data) and instructions for using them, please refer to the "READ ME.txt" file within "Project folder".
| Date made available | Sep 2 2023 |
|---|---|
| Publisher | ZENODO |
Keywords
- Herbarium specimens
- Flowering phenology
- Phenotypic plasticity
- Local adaptation
- Temperture gradients