Aug 4, 2025
|
19 min
|
15.8k views
Exploratory Data Analysis in R, Step by Step: Clean, Filter and Visualize with ggplot2
How to do exploratory data analysis in R: open the data and look at it before you write anything, filter and sort it interactively, clean the variable names, summarise the variable you care about while checking for missing values, then plot it with ggplot2 and iterate on the plot until it says something. This walkthrough runs the whole loop on a real dataset in Positron, with Mine Cetinkaya-Rundel.
What you will learn
What to look at first when a dataset lands, and why the row and column counts matter How to filter and sort in the Data Explorer, and how to turn that filter into code Why cleaning variable names early saves you time later How to summarise a variable and spot missing values before they mislead you How to build a ggplot and fix it when the groups are unequal How to change a colour scheme, relabel categories, and read a function’s help without leaving the IDE How the plot history pane lets you step back through earlier versions Chapters 0:00 What exploratory data analysis is, and what this walkthrough builds 0:25 Opening a new project in Positron 1:48 Loading data and reading it in the Data Explorer 3:44 Starting an R script 4:00 Loading the tidyverse 5:48 Filtering in the data viewer, and turning a filter into code 7:37 Cleaning variable names before you analyse 9:25 Summarising a variable, and handling missing values 11:14 The first ggplot, and fixing unequal group sizes 12:08 Changing the colour scheme with viridis 13:02 Reading a function’s help without leaving the IDE 14:51 Relabelling categories on the plot 15:45 The plot history pane 16:37 Formatting code with Air 19:22 Copying a plot out of the IDE
Learn more Positron: https://positron.posit.co tidyverse: https://www.tidyverse.org R for Data Science: https://r4ds.hadley.nz
air
ggplot2
Positron
tidyverse
tidyverse.org
Exploratory Data Analysis in R
Eda in R
How to Use R for Data Analysis
R Data Analysis Tutorial
Data Analysis in R
Tidyverse Tutorial
Ggplot2 Tutorial
Import Data in R
Clean Data in R
Positron
Data Explorer
R Tutorial
Posit