Supplement 1. Annotated R scripts and sediment core data used to investigate regime shift dynamics in a Galapagos coastal lagoon.

File List

data.csv (MD5: a6d684a54a17794fa0a79c739d403b63)   Diablas lagoon diatom (%), stable carbon isotope (‰) and interpolated Ti influx data (µ Four minor data handling errors have been corrected in the stable carbon isotope data from Seddon et al. 2011.

Script.R (MD5: 4b2c776d9ead3f85f9a3bb37af7a77a3)  Example R script to apply regime shift detection techniques and non-linear regressions in this study for analysis of data.csv.

STARS.R (MD5: 99bcf013e9a5738843813b7815ce74e9)  R script required to implement Sequential T-test Analysis of Regime Shifts Algorithm (Rodionov 2004, 2006) in script.R.


The supplements are designed to provide an example of the framework used to investigate regime shifts in this study. The main file script.R is annotated and split into two parts: STEP 1 investigates whether regime shifts can be identified in diatom assemblages, STEP 2 provides an example of fitting non-linear regressions on the PC1 axis of the diatom data across Regime Shift 1. This can be repeated across other time steps and other datasets (e.g., Ti influx, δ13C) in the way. A number of other packages are required, documented within the script.R file. See R documentation for more information.

To run the script, place all data files into the same directory, open R and set the working directory to that folder. Open up the file script.R and follow the annotations (marked with #) to detect regime shifts in the diatom data and then statistically model the changes in the temporal series.