Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Dealing With Missing Data in R

Cursus bekijken

Oefeninstructies

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

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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()
Code bewerken en uitvoeren