# Code and data associated with Butterfly abundance declines over 20 years of systematic monitoring in Ohio, USA # email: tyson.wepprich@gmail.com R files numbered 0*_* contain the analysis of abundance trends starting from raw data in order of analysis. Bulk of the paper's results come from 05_Abundance_trends.R, which sources needed data files Population indices needed to reproduce analysis of trends are in allpops.csv Raw data can be requested from the North American Butterfly Monitoring network (www.thebutterflynetwork.org) Sample raw data for Cabbage Whites included for testing Phylogenetic tree was produced using custom Python scripts in phylogeny/ directory 01_Data_prep.R Loads data, option to plot temperature trends 02_Fit_gam.R Fits a generalized additive model for each species raw counts to estimate phenology patterns 03_Plot_gam.R Visualizes results of GAM 04_Siteyear_popindex.R Uses GAM to interpolate missing surveys, then estimate a population index for each species x site x year 05_Abundance_trends.R Main analysis, estimates trends with population indices. Code to plot figures (Fig 2-4) of trends 06_Species_traits.R Linear models of species traits effects on trends 07_Phylogenetic.R Phylogenetic GLS models of species traits effects on trends (Fig 5) 08_Sitemap.R Plots map of sites (Fig 1) Utils.R Functions used in other scripts data/ allpops.csv Processed data, needed to replicate paper's analysis, resulting from 04_siteyear_popindex of species x site x year population estimates dailyDD2016.csv Daily temperature and degree-days used for GAM phenology models (from Daymet) OHbflyID.csv Identifiers for genetic sequences for each species used to produce phylogenetic tree OHsites2018update.txt Geographic coordinates and names of monitoring sites RAxML_*.nex Phylogenetic tree from phylogeny/ workflow used in 07_Phylogenetic.R trait analysis sample_rawdata.csv Sample raw data from Ohio Lepidopterists butterfly monitoring for Cabbage Whites sampling_covariates.csv List-length and survey duration used as covariates spain.csv Annual index of total abundance from Catalonia BMS (citation in paper) species_names.csv Species common and scientific names speciestraits.csv Species traits collected from various sources and authors' knowledge (metadata below) speciestraits_meta.txt Metadata explaining species trait variables speciesTrends.csv Intermediate product output by 05_abundance_trends.R, used in 06_Species_traits.R trend_models.rds Intermediate product of 81 species model results ukbms_country.csv Annual collated index of UKBMS countryside species (citation in paper) ukbms_special.csv Annual collated index of UKBMS specialist species (citation in paper) unique_surveys.csv Dates and locations for all surveys, combined with other data in analysis phylogeny/analysis_pipeline code/ Python scripts used to construct trees rax10k_constrainedA_*/ Results from tree constrained by families hypothesized in Espeland et al. 2018 rax10k_unconstrainedA/ Results from unconstrained tree analysis_pipeline.sh Commands used for constructing phylogenetic tree