欠損をファセットで探る(複数プロット)
geom_miss_point() で役立つもうひとつのテクニックは、複数のプロットを作って欠損を探索することです。
これまでの演習と同様に、nabular データを使うことで、さらにファセット化したプロットを作成できます。
年などのデータ中の値や、欠損のようなデータの特徴に応じて、複数のファセットプロットを作ることもできます。
この演習はコースの一部です
Rでの欠損データの扱い方
演習の手順
geom_miss_point()とfacet_wrap()を使い、humidityの欠損状態によってwind_ewとair_temp_cの欠損がどのように異なるかを探索してください。geom_miss_point()とfacet_grid()を使い、humidityの欠損状態およびyearごとに、wind_ewとair_temp_cの欠損がどのように異なるかを探索してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# 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)