Wrangling data

23 February 2026

This week we get into working with data in R, demonstrating how to import data and wrangle it using the tidyverse.

Reading

Assignment

  • Create an R script named intro-r.R in your r-notes/ project folder and go through the material from one or more of the worksheets we have gone through in class.
    • The task is not necessarily to copy or do everything in the worksheets. Rather, play around with how things work using a script in RStudio.
    • Get used to the differences of writing and running code in a script compared to directly in the console.
    • Create objects, create vectors of different types, use different functions, look at documentation for functions with ?function_name.
  • Create a GitHub account. You can follow these instructions from the Carpentries. Choose a username that you would be ok sharing in a professional environment. Mine is jessesadler, and so I can be found at https://github.com/jessesadler.
    • Look through the course website repository and file an issue about something that could be improved or any questions you might have. It might be easiest to do this by looking at the course website and selecting Report an issue, which is usually on the right side of a page.

Activities

  • Discussion: Working with scripts in R
  • Importing data in R
  • Wrangling data with dplyr

Resources

Importing data in R

Wrangling data