LoslegenKostenlos loslegen

Nabular data and summarising by missingness

In this exercise, we are going to explore how to use nabular data to explore the variation in a variable by the missingness of another.

We are going to use the oceanbuoys dataset from naniar, and then create multiple plots of the data using facets.

This allows you to explore different layers of missingness.

Diese Übung ist Teil des Kurses

Dealing With Missing Data in R

Kurs anzeigen

Anleitung zur Übung

  • Explore the distribution of wind east west (wind_ew) for the missingness of air temperature using geom_density() and faceting by the missingness of air temperature (air_temp_c_NA).
  • Build upon this visualization by filling by the missingness of humidity (humidity_NA).

Interaktive Übung

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

# Explore the distribution of wind east west (wind_ew) for the missingness of air temperature 
# using geom_density() and faceting by the missingness of air temperature (air_temp_c_NA).
___ %>%
  bind_shadow(___) %>%
  ggplot(aes(x = ___)) + 
  geom_density() + 
  facet_wrap(~___)

# Build upon this visualization by coloring by the missingness of humidity (humidity_NA).
___ %>%
  ___(___) %>%
  ggplot(aes(x = ___,
             color = ___)) + 
  geom_density() + 
  ___(~___)
Code bearbeiten und ausführen