# The following files can be used to rerun the analysis presented in Knight, Flockhart, Derbyshire, Bosco and Norris. Experimental field evidence shows milkweed contaminated with a common neonicotinoid decreases larval survival of monarch butterflies 1. To run the analysis you must have program R on your computer (https://www.r-project.org/). 2. Save the .RData file, the .R script, and two .bug models to a folder. 3. Open the .RData file which will open in R. The four data files necessary for the analysis are included in the workspace. 4. Open the .R script file and run the code. Note that larvae survival analysis code will take at least 3 hours to run, depending on your computer. The .RData file contains four datasets: plot.data, neonic.data, datE1, and datT - datE1 lists all milkweed observations within plots over the two year study. plot.data summarizes these data by plot for each week monitored annually.Several variables in datE1 were not use in this analysis (ID, quadrant, observer, plant_id, height_cm, herbivory, disease, condition, num_bud_heads, num_flower_heads, num_pods, egg_caterpillar_height_cm, pred_spp, comments). The remaining variables are detailed on a per plot basis in plot.data section below. In datE1 these same variables are measured on a per milkweed basis. - Variables included in plot.data: X: data row number plot_id_year: unique plot ID for each year (2017 and 2018) week_id: week of sampling (2-11; week 1 was excluded) monitor_date: plot monitored for data collection during summer 2017 and summer 2018 treatment: treated (with clothianidin) or untreated plot_density_plant_m2: 16 plants/m2 (high-density) or 4 plants/m2 (low density) num_eggs: number of eggs counted in plot num_first: number of first instar larvae counted in plot num_second: number of second instar larvae counted in plot num_third: number of third instar larvae counted in plot num_fourth: number of fourth instar larvae counted in plot num_fifth: number of fifth instar larvae counted in plot pred: Presence of predators. 0 = not present, 1 = present. year: 2017 or 2018 monitor_date_julian: Data plot monitored during summer 2017 and summer 2018 expressed as the Julian date of the year - Variables included in neonic.data: Sample.project: project the sample belongs to (CN project, i.e. this manuscript) Year: 2017 or 2018 Sample.number: Unique sample identifier within each year Sample.type: Whether sample was taken from larval tissue, milkweed leaves, monarch tissue, pupae, or soil in plot Plot.number: Plot identification where the sample was taken Sample.date: Date of sampling during summer 2017 and summer 2018 Treatment: neonicitinoid-treated or non-treated plot Plot.density: HD (high-density; 16 milkweed/m2), LD (low-density; 4 milkweed/m2), both (samples came from LD and HD plots) Wet.mass..g.: Sample wet mass (g) Dry.mass..g.: Sample dry mass (g) Test: Lab test performed (for all possible neonicotinoids) Pesticide.screen: Whether pesticides were DET (detected), ND (not detected), or NT (not tested) Clothianidin..ppm.: Clothianidin concentration (ppm) Thiamethoxam..ppm.: Thiamethoxam concentration (ppm) Comments: only comment is that one sample was lost during extraction (and therefor not tested) - Variables included in datT (temperature data): X: data row number Year: year Month: month Day: day date: date temp: mean temperature each day of the study at the study location