LoslegenKostenlos loslegen

Faceting to explore missingness (multiple plots)

Another useful technique with geommisspoint() is to explore the missingness by creating multiple plots.

Just as we have done in the previous exercises, we can use the nabular data to help us create additional faceted plots.

We can even create multiple faceted plots according to values in the data, such as year, and features of the data, such as missingness.

Diese Übung ist Teil des Kurses

Dealing With Missing Data in R

Kurs anzeigen

Anleitung zur Übung

  • Use geom_miss_point() and facet_wrap() to explore how the missingness in wind_ew and air_temp_c is different for missingness of humidity.
  • Use geom_miss_point() and facet_grid() to explore how the missingness in wind_ew and air_temp_c is different for missingness of humidity and by year.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Use geom_miss_point() and facet_wrap to explore how the missingness  
# in wind_ew and air_temp_c is different for missingness of humidity
bind_shadow(oceanbuoys) %>%
  ggplot(aes(x = ___,
           y = ___)) + 
  geom_miss_point() + 
  facet_wrap(~___)

# Use geom_miss_point() and facet_grid to explore how the missingness in wind_ew and air_temp_c 
# is different for missingness of humidity AND by year - by using `facet_grid(humidity_NA ~ year)`
bind_shadow(oceanbuoys) %>%
  ggplot(aes(x = ___,
             y = ___)) + 
  geom_miss_point() + 
  facet_grid(humidity_NA~year)
Code bearbeiten und ausführen