Technical track · R

Build evidence you can defend.

Visualization is the analytical spine of the project. Machine learning enters later as a bounded comparison: one transparent baseline plus one extension that the research question can justify.

Tip

This is a research studio, not a compressed repeat of DANL 310 and DANL 320. Selected visualization and machine-learning ideas are applied immediately to the student’s environmental data; methods that do not serve the question are left out.

The weekly studio rhythm

Meeting Primary work Evidence carried forward
Monday research + methods studio Literature, policy setting, research design, method choice, interpretation A decision, claim, or critique to test
Wednesday applied R lab Data intake, transformation, figures, maps, models, validation, reproducibility A reviewed analytical artifact

Each Wednesday artifact becomes part of the next Monday discussion. That loop keeps code, research design, and policy interpretation from becoming separate projects.

Data transformation and audit

Turn raw environmental data into an analysis-ready structure while preserving meaning and provenance. Work may include importing, cleaning, reshaping, joining, recoding, aggregating, and documenting decisions in R.

Questions to keep visible

  • What does one row represent?
  • Which units, time periods, and geographic scales are comparable?
  • What information is lost when values are filtered, joined, or aggregated?
  • Can another reader reproduce the analysis-ready data from the source files and code?

The Data Lab provides a curated source menu and recommended project combinations.

Visualization as the analytical spine

Visualization should appear in every phase rather than in one isolated “charts week.” The student develops a cumulative evidence portfolio:

Stage Required visual evidence Standard
Data portrait Missingness, coverage, distributions, units, and outliers Reveal the limits of the data before making claims
Question-led EDA Relationships, group comparisons, or time patterns One figure = one substantive question
Spatial evidence A normalized choropleth, point/flow map, or raster view when place matters Justify CRS, denominator, scale, and aggregation
Explanatory sequence Two or three coordinated figures with direct labels and annotations Guide a policy reader from pattern to interpretation
Model diagnostics Performance comparison, calibration/error plot, and mapped residuals when spatial Show where the model succeeds and fails—not only one score
Final communication Publication-ready static figures; optional interactive companion Accessible color, honest uncertainty, source note, and reproducible code

Questions to keep visible

  • Is the visual form appropriate for the variable and comparison?
  • Are scales, transformations, labels, and missing values handled transparently?
  • Does the chart reveal evidence—or merely decorate it?
  • What should a policy reader notice first?

Spatial data analysis

Environmental processes are often geographic. Spatial work may include coordinate reference systems, vector or raster data, spatial joins, distance, aggregation, mapping, and analysis of place-based patterns.

Questions to keep visible

  • What geographic unit matches the process and the policy decision?
  • Are layers aligned in space, time, and resolution?
  • How might boundaries, scale, or spatial dependence change the result?
  • Does the map support an inference, a description, or both?

Exploratory work will normally use ggplot2 and sf; tmap or leaflet can add an interactive companion. Google Maps Platform is reserved for an optional publishing or API lab, subject to the boundaries described in the Data Lab.

Is terra worth adding?

Yes, but only when the research question needs raster data. The course can do points, lines, polygons, spatial joins, buffers, and ordinary maps with sf. Add terra only for gridded data such as land cover, elevation, satellite imagery, or climate surfaces. If the selected project never uses a raster, there is no reason to teach it.

For a raster project, one guided lab is enough: read a layer with rast(), inspect resolution and CRS, use crop()/mask(), calculate or reclassify values, summarize cells for study areas with extract() or zonal(), and write the result. The course will continue to use sf for vector work rather than teach terra’s parallel vector system. See the official terra overview and SpatRaster documentation.

Machine learning as a question-led extension

The minimum defensible ML component is a transparent baseline plus one question-appropriate extension. The student does not need to run a catalog of algorithms.

Research structure Baseline Possible extension Primary evaluation
Continuous outcome Mean/seasonal rule or OLS Regularized regression or random forest RMSE/MAE; errors across place and time
Binary outcome Prevalence rule or logistic regression Pruned tree or random forest PR/ROC, calibration, and policy-weighted threshold errors
No defensible prediction target Descriptive profiles PCA or clustering only if a typology answers the question Stability, sensitivity, interpretability, and mapped profiles

The workflow is fixed even when the model changes:

  1. Define the outcome, observation, prediction horizon, decision use, and error cost.
  2. Set aside an untouched test set and choose spatial blocks, time-based splits, or grouped resampling when random row splits would leak information.
  3. Perform imputation, encoding, scaling, and feature construction inside the resampling workflow.
  4. Compare the extension with the baseline using metrics chosen before model fitting.
  5. Inspect performance by place, period, and relevant population—not only in aggregate.
  6. Interpret variable importance or partial dependence as predictive evidence, not a causal policy effect.

Models will be fit directly with familiar functions such as stats::lm()/glm() and, when justified, model-specific packages such as glmnet, rpart, ranger, or xgboost. Data splitting, cross-validation, prediction, and metrics will remain explicit in the code so the student can see each analytical decision.

Questions to keep visible

  • What is the prediction target, and why does predicting it matter?
  • What information is available at the time a prediction would be made?
  • Does the validation strategy reflect the spatial or temporal structure of the data?
  • How should performance, error, and model limitations affect the policy interpretation?

How the evidence enters assessment

Milestone Visualization contribution Machine-learning contribution
Research Kick-off Report Data audit, one question-led EDA figure, and preliminary map when relevant Target, baseline, extension, validation split, and metric—or a justified decision not to use ML
Progress report A coherent two-to-three-figure sequence plus uncertainty or error diagnostics Reproducible baseline results and leakage-safe validation design
Final research paper Publication-ready figure suite; optional interactive map/dashboard companion Baseline-versus-extension results, diagnostics, interpretation, and causal limits
Final comprehensive exam Critique encodings, map design, scale, and uncertainty Select validation, interpret errors, and connect model evidence to policy
Note

A simpler, well-justified analysis is stronger than a complex model disconnected from the policy problem. Machine learning may improve prediction or reveal structure; it does not by itself identify the effect of a policy.

Back to top