Calculation of geographic and macroclimatic distances between populations
We calculated the pairwise geographic distance between island populations and between mainland populations as geodesic distance (shortest distance on the WGS84 ellipsoid) based on the GPS coordinates of the populations, using the “distGeo” function in thegeosphere package (Hijmans 2019) in R 3.4.4 (R Development Core Team 2018). Geographic distances were similar between island and mainland populations (Fig. S6.1).
To calculate the macroclimatic distance between each population pair, we performed a Principal Component Analysis (PCA) of four climate variables reflecting mean and variation in temperature and precipitation available in CliMond V1.2 (Kritikos et al. 2012) at 10 minutes resolution: mean annual temperature (Bio1), annual precipitation (Bio12), temperature seasonality (CV) (Bio4) and precipitation seasonality (CV) (Bio15) using the “prcomp function” in the stats package in R. For populations where climate variables were not available on the global climate maps mostly due to small island size not captured in CliMond, we extracted data from the geographically closest grid cell with available climate values, which was available within 3.5 km away from the focal grid cell for all localities. Variables were centred on zero and scaled to unit standard deviation prior to the analyses. Island and mainland populations occupied a broadly similar climatic space and were best represented in three regions of the PCA corresponding to i) wet, cold climate with constant precipitation and seasonal temperature i.e., temperate oceanic climate, ii) dry climate and seasonal precipitation i.e., temperate continental climate, and iii) wet, hot climate with constant temperatures i.e., tropical oceanic climate (Fig. S3.1). We calculated the pairwise macroclimatic distances between populations on the first two axes of the PCA space using the “dist” function and ‘euclidean’ distance measure in R.