散布図で欠損データを探索する
ggplot2 の散布図では、欠損値はデフォルトで警告とともに除外されます。
geom_miss_point() を使うと、散布図に欠損値を表示できます。これは特別な ggplot2 のジオムで、欠損値をプロット範囲内に移動し、変数の最小値より10%下に表示します。
この可視化を oceanbuoys データセットで練習しましょう。
この演習はコースの一部です
Rでの欠損データの扱い方
演習の手順
- 風の東西成分(
wind_ew)と気温の欠損を探索し、geom_miss_point()で欠損を表示してください。 - 湿度と気温の欠損を探索し、
geom_miss_point()で欠損を表示してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# 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()