Lecture 13

Overview

  • Define Strings, Regular Expressions, and their uses
  • Introduce the stringr() package
  • Practice using Regular Expressions in R to extract info from strings

Before class

Let me know what you want to review about past Homework Assignments: HW2 review and HW3 review. I will pick two questions for each assigment based on your suggestions.

See this Ed Post for more info about the changes we are going to implement in the course based on the mid-quarter feedback. Thanks!

Readings

  • Read Chapter 14 “Strings” in “R for Data Science” 2nd Edition (read it all, especially 14.4 “Extracting data from strings”)
  • Read Chapter 17 from R Programming for Data Science. This book covers the entire range of regular expressions packages and functions: you do not need to understand everything, but you might want to refer back to this when needed. In-class we focus on stringr()
  • stringr() documentation and cheatsheet
  • Optional: Chapter 15 by Rochelle Terman, further explains stringr() using the R for Data Science textbook

Class materials

Run the code below in your console to download today’s in-class materials: usethis::use_course("css-materials/regular-expr")