STAT 266A: Data Visualization and Statistical Programming in R

Fall 2026

COURSE INFORMATION

  • Instructor: Marcela Alfaro-Córdoba
  • Email: macordob@ucsc.edu
  • Office Hours:
    • In person: Tuesdays and Thursdays, after class, just outside the classroom
    • By appointment: calendar appointments
    • If you cannot find an appointment, please post a message on Ed Discussion.

Why come in person? Office hours, discussion sections, and lectures are where you get feedback on your thinking, not just your code, and where you meet the classmates who will review your project. Students in this course learn most when they struggle with a problem first, then talk it through with a person. Please use office hours: bring a half-working piece of code, a question about a reading, or a project idea.

R is commonly used in many scientific disciplines for statistical analysis and its array of third-party packages. Although this course can be taken with no previous knowledge of R, it can also be useful for intermediate users. The emphasis of the topics is to provide a strong foundation in the fundamentals of R, and to teach best practices for scientific computing, descriptive statistics, visual analytics, and applied linear regression. This course takes a “learn by doing” approach. Weekly lectures and discussion sections will focus on walking through code examples and giving students the opportunity to complete assignments in class. Students are strongly encouraged to follow along with the coding examples in class, and bring their own data challenges to apply the skills that they are learning in class.

Course Info

Day Time Location
Lecture Tue, Thu 1:30 pm - 3:05 pm McHenry Lib 1350
Discussion Section (DS) Tuesday 9:50 am - 10:55 am Soc Sci 2, Room 363

Quarter Dates: September 24, 2026 - December 4, 2026 Course Materials: Canvas and Webpage

LEARNING OUTCOMES

At the end of this course, students will be able to:

Without AI assistance (the foundations you must own yourself):

  • Write, run, and debug R code in Positron, and read R documentation and error messages to get yourself unstuck.
  • Read a piece of R code and predict what it will do before running it (trace it by hand).
  • Explore R data structures and data frames, and apply subsetting and control flow to explore and manipulate data.
  • Explain and defend your analytical and coding decisions out loud, to an instructor or a classmate.

With or without AI, as the task requires:

  • Create high-quality visualizations using ggplot2.
  • Manipulate data frames using dplyr and tidyr, and perform basic data analysis, including linear regression, in R.
  • Manage projects using git, GitHub, and Positron, and apply good practices for reproducibility.
  • Generate reports integrating code and explanations using Quarto.
  • Develop effective coding practices for producing readable and maintainable code.
  • Verify and critique code and statistical output, including AI-generated output: check it against the data, its assumptions, and row counts, rather than trusting that it runs.
  • Engage in code review, including review of AI-generated code, to improve quality and collaboration.
  • Use AI tools responsibly: decide when to use them and when not to, disclose your use honestly, and weigh their ethical, environmental, and equity costs.

REQUIRED MATERIALS, TEXTBOOKS AND TECHNOLOGY

Laptop or Desktop Computer

You will need a computer for homework, in-class activities, and projects. You will not be able to complete work on a mobile device. Students who need a laptop can make use of the library’s borrow program: https://library.ucsc.edu/services/computing/borrow-a-laptop.

Technology

Personal computer with Canvas, Zoom, GradeScope, Yuja, and Ed Discussion access. Having R and Positron installed on their computers. All these tools should be free for you, please make sure you have access WITHOUT payment. Ask me if you have any problems, and please DO NOT pay for any of them.

No AI subscription is required or expected. Nothing in this course assumes you have access to a paid AI tool, and no grade depends on having one. Any exercise that involves AI output (see the AI Use Policy) provides that output for you, so no account is needed.

Textbook

While there is no official textbook for the course, we will be assigning readings from the following textbooks.

COMMUNICATION

All lecture notes, assignment instructions, an up-to-date schedule, and other course materials may be found on the Canvas site. I will regularly send course announcements via Ed Discussion. Make sure to check it regularly. If an announcement is sent Monday through Thursday, I will assume that you have read the announcement the next day. If an announcement is sent on a Friday or over the weekend, I will assume that you have read it by Monday.

ASSIGNMENTS & ASSESSMENT

Assessment for the course consists of three components: the final project, DS work, and class participation.

Final Project: 60%

The purpose of the project is to apply what you’ve learned throughout the quarter to analyze an interesting, data-driven research question. The project may be completed individually or in pairs, and moves through five deliveries across the quarter, each building on the one before it. Every deliverable has an individual component, so that each person’s understanding is assessed even in a pair:

Deliverable Weight Format Individual component Due
Proposal 10% Oral presentation Each partner answers questions Week 4 - Tue, Oct 20
Mid-quarter report 15% (10% report + 5% check-in) Written report + 5-minute individual check-in Check-in: you explain your own code and choices Report: Week 6 - Tue, Nov 3. Check-ins: Week 7
Peer review 5% Written review of a classmate’s code and presentation (written by you, no AI) Your own review Week 9 - Tue, Nov 24
Final presentation 15% Oral exam: presentation + individual Q&A Each partner answers questions separately Week 10 - Tue, Dec 1 and Thu, Dec 3
Final written report 15% Written, incorporating feedback from the deliveries above, with an AI-use reflection Individual contribution statement Finals Week, Dec 7-11, 2026

Pairs also submit a contribution statement and keep a shared GitHub repository, so commit history shows who did what. The full requirements, formats, and expectations for each deliverable are in the Final Project Guidelines.

DS Work (PDFs): 30%

Every Tuesday morning, the Discussion Section (DS) is self-guided: you solve the DS exercises on your own without generative AI and upload your solutions as a PDF to Canvas. Printing is optional. Each DS is scored out of 3 points:

  • 2 points, the PDF: graded on completion and effort.
  • 1 point, the discussion check: in a later lecture (usually the following Thursday) we discuss the DS, or you check a classmate’s DS on their laptop. Everyone must be ready to explain any line of their solution, predict the output of a line without running it, or answer a short no-laptop question on the same concept.

The lowest DS grade will be dropped at the end of the quarter, which covers a missed session.

Class Participation: 10%

You are expected to attend in person all of the lectures and discussion sections. Participation is graded on completion using Ed Discussion: short answers posted to the in-class threads or input for the active learning exercises in lecture. Occasional short in-class tasks (for example, the “AI audit” exercises) count here too. There are no separate take-home extra assignments.

Grading Scale

Letter Scale Letter Scale Letter Scale
A+ 96% and above B+ 86-89% C+ 76-79%
A 93-95% B 83-85% C 70-75%
A- 90-92% B- 80-82% D 60-69%

A C grade is the minimum grade to take any classes that have this course as a prerequisite. An F will be assigned to grades of 59% or less. Letter grades will be assigned according to your total percentage score that incorporates all items above.

GRADING POLICY

DS submissions may be turned in up to 3 days late. There will be a 5% deduction for each 24-hour period the submission is late. Each project deliverable will have a hard deadline. However, there will be one chance to improve your grade after each project deliverable is graded. This will allow you to reflect on missing parts of the project or correct your code. A revision must include a short reflection: what you changed, why, and what you learned. For oral deliverables, the revision is a short written follow-up that answers the feedback questions; for the final presentation, it is submitted with the final report.

AI USE POLICY

Generative AI (ChatGPT, Claude, Gemini, Copilot, the assistant built into Positron, and similar tools, including autocomplete-style code suggestions) is powerful, and this course is about learning to use it well. That starts with being able to do the fundamentals yourself. If AI writes your code before you can read it, you will not be able to tell when it is wrong, and in data analysis it is often wrong in ways that still run without errors: a join that silently drops rows, a regression that ignores a violated assumption, a plot that misleads.

The policy differs by activity because the learning goal differs:

Activity AI status Why
Intro to R lessons, in-class exercises, in-class Ed Discussion posts Not allowed These build the mental habits (reading code, tracing it, finding your own way through an error) that you will later rely on to judge AI output.
DS exercises (first and final attempt) Not allowed. Turn off the Positron assistant and any code-completion tools. The struggle is the learning. The Thursday discussion check will show whether you did the thinking.
“AI audit” exercises (Weeks 5 and 9) Provided You examine pre-generated AI output, find its errors, and fix them. No account needed.
Project deliverables (proposal, mid-quarter and final reports) Allowed with disclosure Real analysts use these tools. You may use AI to explain an error, suggest an approach, or review your style. You must be able to explain every line and every choice, out loud.
Peer review Not allowed The review is your own judgment of a classmate’s work.
Oral presentations, check-ins, and Q&A Not allowed These assess what you understand.

Disclosure. Every project deliverable ends with a short “AI use” note: which tools, for what, and what you changed or rejected. “None” is a perfectly good answer. A template is in the Final Project Guidelines. Honest disclosure is never penalized; undisclosed use is an academic integrity issue.

You are responsible for everything you submit, including any error, bias, or unsupported claim that came from an AI tool. “The AI did it” is not an explanation. Language models can fabricate facts and citations, and code tools can produce incorrect or insecure code.

AI literacy. Over the quarter you will practice the three skills this policy relies on:

  • Effective use: specifying a problem clearly, verifying output against the data, and recognizing when not to use AI.
  • Responsible use: disclosing honestly, and distinguishing tools that augment your thinking from those that replace it.
  • Ethical use: where training data comes from and who consented, bias and fairness, environmental cost, and intellectual property. We discuss these in Week 9.

No AI detectors. I do not use AI-detection software, because it is unreliable and it turns a learning relationship into a surveillance one. If something in your work concerns me, I will ask you to walk me through it in person. That is the reason the course leans on oral and in-class components.

Equity. No paid tool is required or assumed (see Technology). If you prefer to use AI minimally or not at all, you can complete every assignment that way, and the “AI audit” exercises provide the AI output so no one needs an account.

Instructor use of AI. In the interest of transparency: course materials (this website, lecture notes, and exercises) are drafted with the help of AI tools and then reviewed and edited by me, and I am responsible for their content. Please tell me if you find an error. Grading and feedback on your work are done by me, not by AI.

If a situation isn’t covered here, ask me before you submit, not after.

COURSE WEEKLY SCHEDULE

This schedule may change during the quarter. Please consult the class webpage for a more updated version.

Weeks 1-9 follow the same three-session rhythm:

  • Thursday, 1:30-3:05 pm (McHenry Lib 1350) — Lecture: new material presented through live coding, followed by in-class practice.
  • Tuesday, 9:50-10:55 am (Soc Sci 2, Room 363) — Discussion Section (DS): self-guided work applying the previous Thursday’s material. You solve the DS exercises on your own and upload your solutions as a PDF to Canvas (printing is optional). In a later lecture, usually the following Thursday, we discuss it together (this is the graded discussion check), before moving on to new material.
  • Tuesday, 1:30-3:05 pm (McHenry Lib 1350) — Lecture: new material continues, same room/time as Thursday’s lecture.
Week Date Time Format Topic Project Milestone
1 Thu, Sep 24 1:30-3:05 pm Lecture Meet + greet + install
Tue, Sep 29 9:50-10:55 am DS Practice: machine setup & install troubleshooting
Tue, Sep 29 1:30-3:05 pm Lecture Intro to R + Positron
2 Thu, Oct 1 1:30-3:05 pm Lecture Help + Data Structures
Tue, Oct 6 9:50-10:55 am DS Practice: Help + Data Structures
Tue, Oct 6 1:30-3:05 pm Lecture Exploring Data Frames
3 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
4 Thu, Oct 15 1:30-3:05 pm Lecture Graphics with ggplot2
Tue, Oct 20 9:50-10:55 am DS Practice: Graphics with ggplot2
Tue, Oct 20 1:30-3:05 pm Presentations DS 3 discussion check + project proposal presentations Proposal due (oral)
5 Thu, Oct 22 1:30-3:05 pm Lecture Vectorization + Functions
Tue, Oct 27 9:50-10:55 am DS Practice: Vectorization + Functions
Tue, Oct 27 1:30-3:05 pm Lecture Linear regression in practice + AI audit #1
6 Thu, Oct 29 1:30-3:05 pm Lecture Writing Data, Splitting and Combining DFs
Tue, Nov 3 9:50-10:55 am DS Practice: Writing Data, Splitting and Combining DFs
Tue, Nov 3 1:30-3:05 pm Lecture Combining data practice I Mid-quarter report due (written)
7 Thu, Nov 5 1:30-3:05 pm Lecture Data Frame Manipulation with dplyr Mid-quarter check-ins begin
Tue, Nov 10 9:50-10:55 am DS Practice: Data Frame Manipulation with dplyr Mid-quarter check-ins (office hours, schedule on Ed)
Tue, Nov 10 1:30-3:05 pm Lecture Combining data practice II
8 Thu, Nov 12 1:30-3:05 pm Lecture Reproducible Reports with Quarto
Tue, Nov 17 9:50-10:55 am DS Practice: Reproducible Reports with Quarto
Tue, Nov 17 1:30-3:05 pm Lecture Your first report
9 Thu, Nov 19 1:30-3:05 pm Lecture Writing good software + AI ethics discussion
Tue, Nov 24 9:50-10:55 am DS Practice: Writing good software
Tue, Nov 24 1:30-3:05 pm Lecture Code Review + AI audit #2 Peer review due (code + presentation)
Thu, Nov 26 — — No class — Thanksgiving Holiday
10 Tue, Dec 1 9:50 am-3:05 pm Work session Project work time + oral Q&A slots
Thu, Dec 3 1:30-3:05 pm Presentations Project presentations + oral Q&A Final presentation (oral exam)
Finals Week Dec 7-11, 2026 — — Final written report due

Note: Week 10 breaks from the regular rhythm — both Tuesday sessions become open project work time, and there is no DS to discuss. Because Thursday, Nov 26 falls on Thanksgiving, discussion of the Nov 24 DS work carries over to the Tue, Dec 1 work session instead of a Thursday lecture.

Each week’s page also links to the matching lesson on the companion Intro to R site, which is developed at the same pace as this course.

FINAL EXAM DATE AND TIME

Final project presentations are held in class during Week 10 (Thu, Dec 3), and individual oral Q&A slots are scheduled during the Week 10 work session (Tue, Dec 1) and Dec 3. The final written report is due during finals week (December 7-11, 2026); the exact date and time will be confirmed once the registrar’s final exam schedule is posted.

ACCESSIBILITY

UC Santa Cruz is committed to creating an academic environment that supports its diverse student body. If you are a student with a disability who requires accommodations to achieve equal access to this course, please affiliate with the DRC. I encourage all students who would benefit from learning more about DRC services to contact DRC by phone at 831-459-2089 or by email at drc@ucsc.edu. For students already affiliated, make sure that you have requested Academic Access Letters, where you intend to use accommodations. You can also request to meet privately with me during my office hours or by appointment, as soon as possible. I would like us to discuss how we can implement your accommodations in this course to ensure your access and full engagement in this course.

TITLE IX/CARE ADVISORY

UC Santa Cruz is committed to providing a safe learning environment that is free of all forms of gender discrimination and sexual harassment, which are explicitly prohibited under Title IX. If you have experienced any form of sexual harassment, sexual assault, domestic violence, dating violence, or stalking, know that you are not alone. The Title IX Office, the Campus Advocacy, Resources & Education (CARE) office, and Counseling & Psychological Services (CAPS) are all resources that you can rely on for support.

Please be aware that if you tell me about a situation involving Title IX misconduct, I am required to share this information with the Title IX Coordinator. This reporting responsibility also applies to course TAs and tutors (as well as to all UCSC employees who are not designated as “confidential” employees, which is a special designation granted to counselors and CARE advocates). Although I have made that notification, you will control how your case will be handled, including whether or not you wish to pursue a formal complaint. The goal is to make sure that you are aware of the range of options available to you and that you have access to the resources you need.

Confidential resources are available through CARE. Confidentiality means CARE advocates will not share any information with Title IX, the police, parents, or anyone else without explicit permission. CARE advocates are trained to support you in understanding your rights and options, accessing health and counseling services, providing academic and housing accommodations, helping with legal protective orders, and more. You can contact CARE at (831) 502-2273 or care@ucsc.edu.

In addition to CARE, these resources are available to you:

  • If you need help figuring out what resources you or someone else might need, visit the Sexual Violence Prevention & Response (SAFE) website, which provides information and resources for different situations.
  • Counseling & Psychological Services (CAPS) can provide confidential counseling support. Call them at (831) 459-2628.
  • You can report gender discrimination and sexual harassment and violence directly to the University’s Title IX Office by calling (831) 459-2462 or by using their online reporting tool.
  • Reports to law enforcement can be made to the UC Police Department, (831) 459-2231 ext. 1.
  • For emergencies, call 911.

ACADEMIC INTEGRITY

All members of the UCSC community benefit from an environment of trust, honesty, fairness, respect, and responsibility. You are expected to present your own work and acknowledge the work of others in order to preserve the integrity of scholarship.

Academic integrity includes:

  • Following the project and AI-use rules of this course
  • Using only permitted materials during oral exams and in-class assessments
  • View exam materials only when permitted by your instructor
  • Keep what you know about exams for yourself
  • Incorporating proper citation of all sources of information
  • Submit your own original work

Academic misconduct includes, but is not limited to, the following:

  • Disclosing exam content during or after you have taken an exam
  • Accessing exam materials without permission
  • Copying/purchasing any material from another student, or from another source, that is submitted for grading as your own
  • Plagiarism, including the use of Internet material without proper citation
  • Using cell phones or other electronics to obtain outside information during an exam without explicit permission from the instructor
  • Submitting your own work in one class that was completed for another class (self-plagiarism) without prior permission from the instructor.
  • Submitting AI-generated work in a way that violates the AI Use Policy above (for example, using AI on DS exercises or peer reviews, or using it on a project deliverable without disclosing it).
  • Misrepresenting individual contribution to a pair project.

Concerns are handled by conversation, not by software: I do not use AI detectors, and I may ask you to walk me through your work in person.

Violations of the Academic Integrity policy can result in dismissal from the university and a permanent notation on a student’s transcript. For the full policy and disciplinary procedures on academic dishonesty, students and instructors should refer to the Academic Misconduct page in the Division of Undergraduate Education.

INTELLECTUAL PROPERTY

The materials in this course are the intellectual property of their creators. As a student, you have access to many of the materials in the course for the purpose of learning, engaging with your peers in the course, completing assignments, and so on. You have a moral and legal obligation to respect the rights of others by only using course materials for purposes associated with the course. For instance, you are not permitted to share, upload, stream, sell, republish, share login information for, or otherwise disseminate any of the course materials, such as: video and audio files, assignment prompts, slides, notes, syllabus, simulations, datasets, discussion threads. Conversely, any materials created solely by you (for example, your videos, essays, images, audio files, annotations, notes) are your intellectual property and you may use them as you wish.

RELIGIOUS ACCOMMODATION

UC Santa Cruz welcomes the diversity of religious beliefs and practices, recognizing the contributions differing experiences and viewpoints can bring to the community. There may be times when an academic requirement conflicts with religious observances and practices. If that happens, students may request reasonable accommodation for religious practices. The instructor will review the situation in an effort to provide reasonable accommodation without penalty. You should first discuss the conflict and your requested accommodation with your instructor early in the term. You or your instructor may also seek assistance from the Dean of Students’ office.

ALL-GENDER RESTROOMS

UC Santa Cruz is committed to the well-being of all students and cares about all students feeling safe and welcome, regardless of their gender identity, expression, and/or embodiment. The Lionel Cantú Queer Center has worked with students and campus staff to create more safe and accessible restrooms for transgender and genderqueer students, staff, faculty, alumni, and UCSC visitors. A complete list of all-gender restrooms on campus was compiled and is maintained by the Cantú Queer Center.

PRINCIPLES OF COMMUNITY

The University of California, Santa Cruz expressly prohibits students from engaging in conduct constituting unlawful discrimination, harassment or bias. I am committed to providing an atmosphere for learning that respects diversity and supports inclusivity. We need to work together to build this community of learning. I ask all members of this class to:

  • Be open to and interested in the views of others
  • Consider the possibility that your views may change over the course of the term
  • Be aware that this course asks you to reconsider some “common sense” notions you may hold
  • Honor the unique life experiences of your colleagues
  • Appreciate the opportunity that we have to learn from each other
  • Listen to each other’s opinions and communicate in a respectful manner
  • Keep confidential discussions that the community has of a personal (or professional) nature
  • Ground your comments on the texts we are studying. Refer frequently to the texts and make them the focus of your questions, comments, and arguments. This is the single most effective way to ensure respectful discussion and to create a space where we are all learning together.

STUDENT SERVICES

Counseling and Psychological Services

Many students at UC Santa Cruz face personal challenges or have psychological needs that may interfere with their academic progress, social development, or emotional well-being. The university offers a variety of confidential services to help you through difficult times, including individual and group counseling, crisis intervention, consultations, online chats, and mental health screenings. These services are provided by staff who welcome all students and embrace a philosophy respectful of clients’ cultural and religious backgrounds, and sensitive to differences in race, ability, gender identity and sexual orientation.

Student Success and Engagement Hub

The Division of Student Success provides campus-wide coordination and leadership for student success programs and activities across departments, divisions, colleges, and administrative units.

Tutoring and Learning Support

At Learning Support Services (LSS), undergraduate students build a strong foundation for success and cultivate a sense of belonging in our Community of Learners. LSS partners with faculty and staff to advance educational equity by designing inclusive learning environments in Modified Supplemental Instruction, Small Group Tutoring, and Writing Support. When students fully engage in our programs, they gain transformative experiences that empower them at university and beyond.

Slug Support Program

College can be a challenging time for students and during times of stress it is not always easy to find the help you need. Slug Support can give help with everything from basic needs (housing, food, or financial insecurity) to getting the technology you need during remote instruction. To get started with SLUG Support, please contact the Dean of Students Office at 831-459-4446 or you may send us an email at deanofstudents@ucsc.edu.

Slug Help/Technology

The ITS Support Center is your single point of contact for all issues, problems or questions related to technology services and computing at UC Santa Cruz. To get technological help, simply email help@ucsc.edu.

On-Campus Emergency Contacts

For all other help and support, including the health center and emergency services, click here to go to UCSC’s Emergency Services page. Always dial 9-1-1 in the case of an emergency.


This syllabus is subject to change. Any changes will be announced in class and posted on Ed Discussion.

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.