nabularデータと欠損別の要約
この演習では、ある変数の欠損状況に応じて、別の変数のばらつきを nabular データでどのように調べるかを学びます。
naniar の oceanbuoys データセットを使い、ファセットを用いて複数の可視化を作成します。
これにより、欠損の異なる層を見比べながら探索できます。
この演習はコースの一部です
Rでの欠損データの扱い方
演習の手順
- 気温の欠損状況ごとに、風の東西成分(
wind_ew)の分布をgeom_density()で可視化し、気温の欠損(air_temp_c_NA)でファセット分割してください。 - さらに、湿度の欠損(
humidity_NA)で塗りつぶし(fill)を分けて、可視化を発展させてください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# 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() +
___(~___)