使用分面探索缺失情况
由于 geom_miss_point() 是一个 ggplot 的 geom,您可以将它与 ggplot2 的功能(如分面)一起使用。
这意味着我们可以快速探索缺失情况,并且始终在熟悉的 ggplot2 语法范围内完成可视化。
本练习是课程的一部分
在 R 中处理缺失数据
练习说明
- 探索风速与气温中的缺失情况,并使用
geom_miss_point()展示缺失;按年份进行分面以进一步分析。 - 探索湿度与气温中的缺失情况,并使用
geom_miss_point()展示缺失;按年份进行分面以进一步分析。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Explore the missingness in wind and air temperature, and display the
# missingness using `geom_miss_point()`. Facet by year to explore this further.
ggplot(___,
aes(x = ___,
y = ___)) +
___() +
facet_wrap(~year)
# Explore the missingness in humidity and air temperature, and display the
# missingness using `geom_miss_point()` Facet by year to explore this further.
ggplot(___,
aes(___,
___)) +
____() +
facet_wrap(~year)