Module 6

Data types & Vectors & For Loops

Author
Affiliation

Lars Schöbitz

ETH Zurich

Learning Objectives

  1. Learners can identify different ways of accessing a vector from a dataframe
  2. Learners can list the four main atomic vector types in R.
  3. Learners can create cross-references to figures and tables using labels and captions in Quarto documents
  4. Learners can recognize when a for loop is appropriate for repetitive tasks in data analysis

Slides

View slides in full screen | Download slides as PDF

Readings

  1. Read R for Data Science - Chapter 20 - Vectors
  2. Read R for Data Science - Chapter 26 - Iteration
  3. Read R for Data Science - Chapter 27 - A field guide to base R

Assignments

Due date: November 05, 2025

  • Assignment 1: Cross-references with Quarto (includes optional bonus on for-loops)
  • Assignment 2: Good enough practices in scientific computing
  • If you haven’t yet, then: Assignment 3: Identify data for your capstone project
About Assignment 1

Assignment 1 includes a required section on cross-references and an optional bonus section on for-loops for those who want to deepen their understanding of iteration in R.

Thank you for working through these assignments.

Quiz

Due date: November 12, 2025

Complete this quiz after you have worked through the assignments. Completing the quiz of each week is required to receive a course certificate at the end of the course.

Access the quiz here: https://u4x6xe-lars-sch0bitz.shinyapps.io/md-06-quiz/ Note: The quiz will be available once it has been deployed.

You can verify your submissions using our Live Quiz Checker.

Session Recording

You can access the Zoom recording of Module 6 on October 30, 2025. To watch the recording, you will need to register for it.

Register for the recording at this link: https://ethz.zoom.us/rec/share/cr-NCsCxzdYGWxExusXWmChBua941_dwEoz7Xs5qU-0ygvXsHlqdfIzyPg9yC3C0.jqJOJY8ja6i_WyYI

Note: The video will show once the recording has been processed.