Quickstart Guide: Natural History Records and the Case of the Missing Absence

Installation, Package Setup, Data Architecture, and Application Launch

1. Download and Install R and RStudio

Before launching the modeling modules, install R (the statistical computing engine) and RStudio Desktop (the integrated development environment):

  1. Install R (Version 4.3+):
    • Visit the Comprehensive R Archive Network (CRAN) at https://cran.r-project.org/.
    • Select your operating system (Download R for Windows, macOS, or Linux) and run the installer using default settings.
  2. Install RStudio Desktop:

2. One-Time Package Installation

Open RStudio, click into the Console pane, paste the following one-time setup script, and press Enter to install all required spatial, visualization, and modeling packages:

required_pkgs <- c(
  "shiny", "dplyr", "tidyr", "DT",
  "terra", "rpart", "rpart.plot", "randomForest"
)

new_pkgs <- required_pkgs[!(required_pkgs %in% installed.packages()[, "Package"])]
if (length(new_pkgs) > 0) {
  install.packages(new_pkgs, dependencies = TRUE)
}
message("All required packages are installed and ready!")

3. Downloading the Project Folder & Launching the Apps

  1. Download & Extract the Course Folder from Google Drive:
    • Open the shared Google Drive link provided by your instructor and click Download (Google Drive will package the folder into a .zip archive).
    • Unzip (Extract All) the downloaded archive into a permanent folder on your computer (for example, Documents/Bursera_SDM_Suite/). Do not run the apps from inside a compressed .zip preview window.
    • Verify that the data/ and R/ subfolders sit directly inside your project directory alongside the three application scripts:
      • app1.R — Module 1: Realized Niche, Herbarium Associates & CART
      • app2.R — Module 2: Random Forest, Gray Vireo Dispersal & Lower Colorado Trough
      • app3.R — Module 3: Deep Time Refugia, 21st-Century Forecasts & Climate Velocity
  2. Launch Any Module in RStudio:
    • Open RStudio and go to File -> Open File… to open app1.R (or Modules 2 or 3).
    • Set your working directory to the project folder via Session -> Set Working Directory -> To Source File Location.
    • Click the green Run App button in the top-right corner of the script editor.

4. Data Architecture Overview

Because this suite focuses on southwestern North America (-120° to -105°W, 22.5° to 36.0°N for flora; -122° to -104°W, 22.5° to 41.5°N for avian flyways), all spatial layers and occurrence tables are standardized in native WGS84 geographic coordinates (EPSG:4326):

  • 1 km Environmental Extraction + Multi-Scale Thinning (data/target_presences_wgs84.csv, data/background_pool_wgs84.csv): Every presence and inferred absence record carries environmental values read at 1 km (30 arc-sec) resolution alongside 1 km, 5 km, and 10 km grid IDs so you can test spatial scale interactively.
  • 5 km Regional Rasters (data/env_5km_wgs84.tif, data/usnvc_5km_wgs84.tif): Modern WorldClim 2.1 climate layers (BIO1–BIO19), terrain (ELEV, maximum TRI, mean TPI), and ESA WorldCover / USNVC vegetation layers (with Frac_Barren_Playa aggregated by pixel minimum to preserve rocky micro-refugia).
  • Deep Time & Future Projections (data/bioclim_paleo_5km_wgs84.tif, data/bioclim_future_5km_wgs84.tif): Last Glacial Maximum (21 ka) and Mid-Holocene (6 ka) reconstructions (Beyer2020) paired with CMIP6 ACCESS-CM2 mid- and late-century projections (SSP2-4.5 & SSP5-8.5).
  • Independent Ecological & Fossil Overlays (data/gray_vireo_occurrences.csv, data/neotoma_bursera_fossils.csv, data/associated_taxa_frequencies.csv): Seasonally classified Vireo vicinior detections, radiocarbon-dated Neotoma packrat midden macrofossils, and the full herbarium associates frequency table.

Full GBIF archive DOIs, processing protocols, and citations are documented in the Data Sources & Curatorial Methods section of the lab manual.