결측치 제거
> #함수의 결측치 제외 기능 이용하기 - na.rm = T > mean(df$score, na.rm=T) [1] 4 > library(dplyr) > df %>% filter(is.na(score)) sex score 1 F NA > df %>% filter(!is.na(score)) sex score 1 M 5 2 F 4 3 3 4 M 4 > sum(df_nomiss$score) [1] 16 > df_nomiss % filter(!is.na(score)&!is.na(sex)) > df_nomiss sex score 1 M 5 2 F 4 3 M 4 > df df sex score 1 M 5 2 F 4 3 3 4 M 4 5 F NA > is.na(df) sex score [1,] FALSE FALSE..
Data Science/R package
2022. 5. 1. 21:21
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
반응형