Data Wrangling for R Programmings
Data wrangling in R is the work of cleaning and reshaping data into a tidy form, mainly with dplyr and tidyr from the tidyverse. Verbs such as filter, select, mutate, group_by and summarise handle rows and columns, while packages like stringr, lubridate and forcats help with text, dates and categories.
Stage: Tidyverse · Part of the R Programming roadmap · Last reviewed 19 November 2026
What to learn in Data Wrangling
- Filter rows and select columns using dplyr verbs
- Chain steps together with the pipe operator
- Summarise by group using group_by() and summarise()
- Reshape data between wide and long with pivot_longer() and pivot_wider()
- Parse dates with lubridate and clean text with stringr
Data Wrangling interview questions
What is tidy data?
Tidy data has one variable per column, one observation per row and one value per cell. This layout lets dplyr, tidyr and ggplot2 work together without extra reshaping. Wide spreadsheets with years as column headers are a common untidy example fixed by pivot_longer().
What is the difference between mutate() and summarise()?
mutate() adds or changes columns and keeps the same number of rows. summarise() collapses rows into fewer rows, usually one per group, returning summary values like a mean. After group_by(), summarise() gives one row for each group.
Where Data Wrangling fits in the R Programming roadmap
Data Wrangling belongs to the Tidyverse stage (beginner level), which takes about 19 hours. Wrangle data.
Other units in this stage
Back to the full R Programming roadmap