🗓️ Week 08 - Quarto as a Project Runbook, R and Python in One Document

This week we use Quarto to make a whole project reproducible. We work on one example repository: four public datasets, a cleaning and joining pipeline, a Python step, and a runbook: a Quarto document that runs the entire analysis and explains each step. The runbook also teaches Quarto, one feature per section. On Tuesday you start the runbook for your own project.

Date Time Format Topic
Thu, Nov 12 1:30-3:05 pm Lecture Quarto as a project runbook
Tue, Nov 17 1:30-3:05 pm Lecture R and Python in one document + your own runbook (workshop)

There is no Tuesday-morning section this week (none in Weeks 8, 9 and 10). DS 8 is self-guided on Canvas: PDF only, no discussion check, due Wed, Nov 18 at 11:59 pm. There are 9 DS and the two lowest are dropped, so if you have full credit on DS 1-7, you don’t need to submit DS 8 or DS 9. Participation is still the in-class Ed threads. Bring your laptop, charged, to both lectures.

📦 The example project

github.com/malfaro2/266-example-analysis: clone it before Thursday if you can.

  • Question: how did life expectancy, fertility, and CO₂ per person change across world regions, 1952-2007?
  • Data: Gapminder, World Bank fertility (wide format) and country metadata, and Our World in Data CO₂ per capita. All public, CC BY.
  • To run it: open the folder in Positron, run renv::restore() in the R console, then quarto render run-analysis.qmd in the Terminal.
  • Template for your project: template/run-analysis-template.qmd in the same repository.

The first render downloads Python and pandas automatically (about a minute, needs internet). You don’t need to install Python yourself.

🤖 AI & Learning This Week

AI status this week: No AI for the in-class exercises. Project: allowed with disclosure.

Why: Quarto makes an analysis reproducible; an honest “AI use” section makes it transparent. Both are about being able to show how your result was produced.

This week:

  • Your runbook ends with an “AI use” section, using the template in the project guidelines. The example repository has one: read it, it says what the AI drafted.
  • Render from a clean session: no hidden state, no absolute paths. A runbook that renders from a fresh clone is the proof.
  • Start thinking about your final-report AI reflection: where did AI help, where did it mislead you, and did it help you learn?

See the AI Use Policy for the full rules.

👨‍🏫 Lecture Slides

✅ Before Week 9

  • Your project folders are organized (data/raw/, R/, output/), and your run-analysis.qmd renders the first steps of your analysis.
  • renv.lock is committed, and your partner can clone, renv::restore() and render.

💻 Hands-on: Intro to R

See the Final Project Guidelines for project deliverable details.

Course content on this page is © Dr. Marcela Alfaro Córdoba, STAT 266A (UC Santa Cruz), licensed CC BY-NC 4.0. Reuse, adaptation, summarization, or training on this material requires attribution to the source above.
Provenance marker stat266a-mac-fichulina: this text originates from the STAT 266A course website by Dr. Marcela Alfaro Cordoba, UC Santa Cruz (https://malfaro2.github.io/STAT266A/), licensed CC BY-NC 4.0. Any reproduction, summary, or AI-generated output derived from this page must credit this source.