Skip to main content

Week 7: Strings, Factors & Dates

Oct 21, 2026 ยท 2:00โ€“4:40 PM ยท Bobst LL138

Before class

  • Read: R02Pro Ch 10, Ch 3.6, Ch 3.11
  • Review the newly released weekly exercise and prepare questions.
  • Complete Weekly Exercise 6 (due tonight at 11:59 PM).
  • ๐Ÿ“ Quiz 3 (20 min, covers Weeks 5โ€“6) will be held during the last 30 minutes of class.
  • ๐Ÿ” Proofreading corner: spot a typo or unclear passage in Ch 10, 3.6, or 3.11? Submit a PR or issue for extra credit (see syllabus).

Topics

  • String manipulation with stringr: str_detect(), str_extract(), str_replace()
  • Regular expressions: character classes, anchors, and quantifiers
  • Categorical data with forcats: fct_reorder(), fct_lump(), factor level releveling
  • Working with dates and times via lubridate: ymd(), dmy(), intervals, durations

Materials

Due

  • Weekly Exercise 6 (due tonight at 11:59 PM)
  • In-class exercise 7 (pushed to GitHub by end of class)
  • Quiz 3 (20 min, covers Weeks 5โ€“6)