This repository contains the R scripts for Carlson, Bevins, and Schmid (2021) "Plague risk in the western United States over seven decades of environmental change", preprint forthcoming on bioRxiv. Primary data are available on reasonable request, while environmental data are all freely and openly available from public sources.
There's also a copy of the preprint available that's been compressed for legibility, as the main preprint is nearly impossible to scroll through due to the number of high-resolution maps and figures.
Scripts are organized into seven folders marking different stages of the pipeline:
A: Prepare data
ββ A1 Re-rasterize rodents.R
ββ A2 Soil macronutrient kriging.R
ββ A3 SoilGrids resampling.R
B: Extract and generate model datasets
ββ B1 Process and load environmental layers.R
ββ B2 Extract NWDP data.R
ββ B3 Extract human data.R
C: Main models and attribution models
ββ C0 Reload environment.R
ββ C1 Wildlife baseline model.R
ββ C2 Human baseline model.R
ββ C3 Wildlife attribution model.R
ββ C4 Human attribution model.R
D: Data visualization
ββ D1 Main figures.R
ββ D2 Partial dependence multipanel.R
ββ D3 Ternary.R
ββ D4 Variable importances.R
ββ D5 Alternate model maps.R
ββ D6 Spartials.R
ββ D7 Alternate model 1 partial figures.R
ββ D8 pH GAMs.R
E: Cross-validation on withheld data
ββ E1 Cross-validation 2000 to 2005.R
F: Generate alternate datasets
ββ F1 Wildlife Alt2 Pseudoabsences.R
ββ F2 Wildlife Alt3 Just coyote.R
G: Alternate models
ββ G0 Reload environment - alt for elevation.R
ββ G1 Wildlife Alt1 full variables.R
ββ G2 Human Alt2 full variables.R
ββ G3 Wildlife Alt2 pseudoabsences.R
ββ G4 Wildlife Alt3 coyote model.R