대치된 데이터의 히스토그램 만들기
이제 geom_miss_point()의 첫 시각화를 다시 만들 수 있으니, 이를 다른 탐색 작업에도 어떻게 적용할 수 있는지 살펴보겠습니다.
유용한 작업 중 하나는 히스토그램을 사용해 특정 변수의 결측 개수를 평가하는 것입니다. 지난 연습 문제에서 만든 ocean_imp_track 데이터셋이 이 세션에 로드되어 있으니 이를 사용해 볼게요.
이 연습은 강의의 일부입니다
R에서 결측치 다루기
연습 안내
대치 및 추적된 데이터 ocean_imp_track를 사용해서 다음을 수행하세요:
air_temp_c값을 탐색하되,air_temp_c_NA로 결측량을 시각화하세요.humidity의 결측을humidity_NA로 탐색하세요.- 연도별로
air_temp_c의 결측을facet_wrap(~year)으로 탐색하세요. - 연도별로
humidity의 결측을facet_wrap(~year)으로 탐색하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Explore the values of air_temp_c, visualizing the amount of missings with `air_temp_c_NA`.
p <- ggplot(___, aes(x = ___, fill = ___)) + ___()
# Expore the missings in humidity using humidity_NA
p2 <- ggplot(___, aes(x = ___, fill = ___)) + ___()
# Explore the missings in air_temp_c according to year, using `facet_wrap(~year)`.
p + facet_wrap(~___)
# Explore the missings in humidity according to year, using `facet_wrap(~year)`.
p2 + facet_wrap(~___)