README.txt This document described the dryad data package that accompanies the paper: Van Buskirk J, Smith DC. 2021. Ecological causes of fluctuating natural selection on habitat choice in an amphibian. Evolution For more details, check the annotation in the R script, or contact either of the authors (joseph.vanbuskirk@uzh.ch or dsmith@williams.edu). ************************** (1) Set up your working directory. The working directory should have two subdirectories called “figures” and “models”. Copy all files into the working directory. Enter the path to this working directory near the top of the script called “VanBuskirk_Smith_2021_Rscript.R”, right at the place where it says “Set your working directory.” (2) R scripts. There are two. “VanBuskirk_Smith_2021_Rscript.R” is the script that runs all analyses and draws all figures in the paper. Hereafter, this is referred to as “the script”. “VanBuskirk_Smith_2021 sourced functions.R” includes functions used by the script; it will be sourced from the script. (3) Image files. There are six jpeg files, corresponding to the three panels each in Figs. 1 and S1. These are imported by the script and used to draw the figures. (4) Data files. There are 9 text files. These are imported by the script. -- “Aeshna numbers.txt” -- dragonfly census data. Variables are defined in the script. -- “All tadpole broods 1983-1998.txt”. Variables are island (only “ng” is relevant), species (only “pt” is relevant, year, pool, brood, catches (if 2 there will be one growth interval, if 3 there will be 2 growth intervals, etc.), origin (2 if at least some tadpoles in this brood washed in from another pool), date1 (first capture), inter1 (duration of the first capture interval), fate1 (1 and 2 = okay, 3 = all or most of brood washed out by a rainstorm, 4 = all or most of brood washed out by waves, 5 = pool dried out, 6 = no second measure because we left the island or chose not to measure them, 9 = brood disappeared for unknown reasons), nbrd11 (number in brood at beginning of first capture interval), nbrd12 (number in brood at end of first interval), npool1 (number in pool at beginning of first interval), area1 (pool area at beginning of first interval), den1 (density nr/m2 at beginning of first interval), geoden1 (geometric mean density over the course of the first capture interval), temp1 (mean temperature during the first interval), size11 (mean body size at beginning of the first interval, mm), size12 (mean size at end of first interval), date2 (date of first capture of the second interval; all following variables are as for first capture interval), inter2, fate2, nbrd21, nbrd22, npool2, area2, den2, geoden2, temp2, size21, size22, date3 (all the same variables for the third capture interval), inter3, fate3, nbrd31, nbrd32, npool3, area3, den3, geoden3, temp3, size31, size32, date4 (all the same variables for the fourth capture interval), inter4, fate4, nbrd41, nbrd42, npool4, area4, den4, geoden4, temp4, size41, size42. -- “Dates of fieldwork 1983-1998.txt” -- dates between which we checked the pools at two-day intervals. -- “Growth assuming rank order.txt” -- daily proportional growth rates of individual tadpoles, assuming that mortality was unrelated to size and rank order was retained over the recapture intervals. Variables are defined in the script. -- “Pool list.txt” -- all pools, with their locations and sizes. -- “Pool sizes 1983-1998.txt” -- sizes of pools for each year and date. Variable names are self-explanatory. Date 1 = 1 May. -- Pool temperatures 1983-1998.txt” – daily minimum and maximum temperatures from a single pool (pool 12 on Edwards Island). Variables are defined in the script. -- “Pool XYZ coordinates.txt” -- locations of all pools in m. The Z-dimension is height above the lake level in the year when we mapped pools. -- “Wave heights 1983-1998.txt” -- wave heights at the North Government Island study area every two days in every year. Our system measures the highest waves over the previous 48-hour period. 36 = no waves, 0 = waves reached the edge of the forest.