Supplement 1. Code for conducting the analyses and generating the figures in this paper, including the raw data.
Datasets usually provide raw data for analysis. This raw data often comes in spreadsheet form, but can be any collection of data, on which analysis can be performed.
hb-migration.r (MD5: 1904c1692a02d984890e4575d0eeb4e6)
R script that imports the eBird, map, and equal-area icosahedron data, summarizes the population-level migration patterns, runs the statistical analyses, and outputs figures.
migration-fxns.r (MD5: a2ae2a47c066a253f18cad5b13cddcf6)
R script that holds the relevant functions for executing the hb-migration.R script.
BBL-Appendix.r (MD5: 370c701d6afb07851907922dcab51de4)
R script that imports the Breeding Bird Laboratory data and outputs the figures for the Appendix.
output-data.zip (MD5: 36e3a92a7d35e84b299d82c8bd746950)
Folder containing the partially-processed text files (15 .txt files, 3 per species for centroids, migration dates, and migration speed) for the main analyses and figures in the paper. These text files can be used in part II of hb-migration.r and contain output data on the daily population-level centroids, migration dates, and migration speed. Part I of hb-migration.r relies on raw eBird data, which was queried from the eBird server directly. The raw eBird data can be requested through their online portal after making a user account (http://help.ebird.org/customer/portal/articles/1010524-can-i-download-raw-data-from-ebird-). The equal-area icosahedron maps are available at (http://discreteglobalgrids.org/). The BBL data, used in BBL-Appendix.R, can be requested from the USGS Bird Banding Laboratory (http://www.pwrc.usgs.gov/BBL/homepage/datarequest.cfm).
The code and data in this supplement allow for the analyses and figures in the paper to be fully replicated using a data set of manipulated communities collected from the literature.
Requirements: R 3.x, and the following packages: chron, fields, knitr, gamm4, geosphere, ggplot2, ggmap, maps, maptools, mapdata, mgcv, plyr, raster, reshape2, rgdal, Rmisc, SDMTools, sp, spaa, and files containing functions specific to this code (listed above).
The analyses can then be replicated by changing the working directory at the top of the file hb-migration.R to the location on your computer where you have stored the .R and .csv files and running the code. Note that to fully replicate the analyses, the data will need to be requested from the sources listed above.
Starting at Part II in hb-migration.R, it should take approximately 30 minutes to run all the code from start to finish. Figures should output as pdfs in your working directory. If you download the raw data and run the analyses starting at Part I, you will need a workstation with large memory to run the analyses in a reasonable amount of time since the raw eBird datafiles are very large.
Version Control Repository: The full version control repository for this project (including post- publication improvements) is publicly available https://github.com/sarahsupp/hb-migration. If you would like to use the code in this Supplement for your own analyses it is strongly suggested that you use the equivalent code in the repositories as this is the code that is being actively maintained and developed.
Data use: Partially-processed data is provided in this supplement for the purposes of replication. If you wish to use the raw data for additional research, they should be obtained from the original data providers listed above.