R/빅분기 실기(독학)
R 빅데이터분석기사 실기 작업형1 독학(이상치) 2일차 빅분기
Ninestar
2022. 12. 18. 05:37
반응형
주어진 데이터에서 이상치(소수점 나이)를 찾고 올림, 내림, 버림(절사)했을때 3가지 모두 이상치 'age' 평균을 구한 다음 모두 더하여 출력하시오
library(dplyr)
df<-read.csv('../input/bigdatacertificationkr/basic1.csv')
df%>%filter((age*10)%%10!=0)%>%mutate(up=ceiling(age),low=floor(age),tr=trunc(age))
%>%summarise(mean1 = mean(up),mean2=mean(low), mean3=mean(tr))
%>%apply(1,sum)
#정답:70
