🗓️ Week 03 - Control Flow, Cleaning Data in Practice

This week introduces control flow (loops and conditionals) and then puts subsetting to work cleaning real data.

Date Time Format Topic
Thu, Oct 8 1:30-3:05 pm Lecture Control Flow
Tue, Oct 13 9:50-10:55 am DS Practice: Control Flow
Tue, Oct 13 1:30-3:05 pm Lecture Cleaning data in practice

Solve the Tuesday-morning DS on your own without generative AI, print your solutions as a PDF, and bring the printout to next Thursday’s lecture. There we discuss it on paper, pencil in hand, and each DS includes a 1-point discussion check: be ready to explain any line of your solution or predict its output without running it.

This week only: the DS 3 discussion check moves from Thu, Oct 15 to Tue, Oct 20, 1:30 pm, just before the project proposals. Bring your printout then. The Canvas upload deadline doesn’t change.

🤖 AI & Learning This Week

AI status this week: No AI.

Why: Control flow and subsetting are where you learn to trace code by hand. If you can’t say what a loop or a filter does, you can’t verify anyone else’s, human or AI.

This week:

  • Trace-by-hand warm-ups in lecture: predict the output of a loop or if chain on paper, then run it and compare.
  • Cleaning data in practice: after each cleaning step, check how many rows and missing values you have. This becomes your verification habit for the project.

See the AI Use Policy for the full rules.

👨‍🏫 Lecture Slides

💻 Hands-on: Intro to R

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.