CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Dealing With Missing Data in R

Afficher le cours

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().

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de 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()
Modifier et exécuter le code