The code and data in this repository can most easily be used by creating a fork to the linked github repository https://github.com/cjbwalsh/lsc_dbs_wq. The large data files stored in the OSF repository are downloaded to the local version of the forked github repository when the script load_data_from_OSF.R is run. (This file is sourced, and the data downloaded, if you run or knit most of the Rmd files.)
`wq_manuscript.Rmd` and `wq_appendix_S1.Rmd` contain the source code (RMarkdown) for the manuscript and supplementary material, respectively. The seven `wq_methods_*.Rmd` documents contain the code for assembling the data, and compiling, selecting, sampling and interpreting the hierarchical linear models: their content is described in `wq_appendix_S1.Rmd`.
Data for Figure 1 are downloaded from the data repository from an earlier paper (https://doi.org/10.17605/OSF.IO/57AZQ). Note that the file `ei_ts.rda` differs slightly from the equivalent file used in the earlier paper (see https://osf.io/57azq/wiki/Errata/).
`lsc_dbs_wq.bib`, `ecol-app.csl`, and `officedown_template.docx` are used in knitting the Rmd documents. `code/misc_functions.R` contains purpose-written functions used for interpreting and plotting the data.