Intro to R
  • Home
  • Syllabus
  • Lectures
  • Homework
  • Software Setup

On this page

  • Info and Materials
  • Learning Objectives
  • Before Class
  • Readings

Lecture 4: Intro to dplyr, Pipes

Published

July 8, 2025

Info and Materials

  • Date: July 8, 2025
  • Topics: Wrangling Data with dplyr, Using R Pipes
  • Slides: View Slides
  • Code: usethis::use_course("csp-materials/dplyr-pipes")

Learning Objectives

  • Approach coding tasks as problem-solving by thinking through the steps before writing code
  • Understand R logical operators
  • Apply key dplyr functions such as filter(), group_by(), and summarize()
  • Chain commands using the pipe |> and recognize mistakes to avoid

Before Class

  • Review the Lecture 3 materials to get ready for today’s in-class quiz
  • Bring your laptop to every class

Readings

Skim the readings before or after class to get the big picture and prep for quizzes and assignments:

  • “Chapter 3 Data transformation” from “R for Data Science” 2nd Edition

Additional Resources (not needed for quizzes or homework, but helpful to dive deeper):

  • dplyr Cheat Sheet
  • dplyr Official Documentation