Nabular 데이터와 결측 여부별 채우기
요약 통계도 유용하지만, 흔히 말하듯이 한 장의 그림이 천 마디 말을 대신하죠.
이 연습 문제에서는 nabular 데이터를 활용해, 한 변수의 결측 여부에 따라 다른 변수의 값 분포가 어떻게 달라지는지 살펴보겠습니다.
여기서는 naniar의 oceanbuoys 데이터셋을 사용합니다.
이 연습은 강의의 일부입니다
R에서 결측치 다루기
연습 안내
- 먼저
vis_miss()를 사용해oceanbuoys의 결측 구조를 살펴보세요. - 공기 온도 결측 여부에 따라 바람 동서(
wind_ew) 분포를geom_density()로 살펴보세요. - 습도 결측 여부에 따라 해수 온도 분포를
geom_density()로 살펴보세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# First explore the missingness structure of `oceanbuoys` using `vis_miss()`
vis_miss(___)
# Explore the distribution of `wind_ew` for the missingness
# of `air_temp_c_NA` using `geom_density()`
bind_shadow(oceanbuoys) %>%
ggplot(aes(x = ___,
color = air_temp_c_NA)) +
geom_density()
# Explore the distribution of sea temperature for the
# missingness of humidity (humidity_NA) using `geom_density()`
___(___) %>%
ggplot(aes(x = ___,
color = ___)) +
geom_density()