Get startedGet started for free

Exploring missing data with scatter plots

Missing values in a scatter plot in ggplot2 are removed by default, with a warning.

We can display missing values in a scatter plot, using geom_miss_point() - a special ggplot2 geom that shifts the missing values into the plot, displaying them 10% below the minimum of the variable.

Let's practice using this visualization with the oceanbuoys dataset.

This exercise is part of the course

Dealing With Missing Data in R

View Course

Exercise instructions

  • Explore the missingness in wind east west (wind_ew) and air temperature, and display the missingness using geom_miss_point().
  • Explore the missingness in humidity and air temperature, and display the missingness using geom_miss_point().

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Explore the missingness in wind and air temperature, and  
# display the missingness using `geom_miss_point()`
ggplot(oceanbuoys,
       aes(x = ___,
           y = ___)) + 
  geom_miss_point()

# Explore the missingness in humidity and air temperature,  
# and display the missingness using `geom_miss_point()`
ggplot(___,
       aes(x = ___,
           y = ___)) + 
  geom_miss_point()
Edit and Run Code