R 빅데이터분석기사 실기 작업형1(시계열 주말,평일) 18일차 빅분기 독학
R/빅분기 실기(독학)
2022. 12. 18. 19:22
주어진 데이터에서 2022년 5월 주말과 평일의 sales컬럼 평균값 차이를 구하시오 (소수점 둘째자리까지 출력, 반올림) library(dplyr) library(lubridate) df%filter(year==2022&month==5) weekend%filter(wday==1|wday==7) weekday%filter(!(wday==1|wday==7)) ans
R 빅데이터분석기사 실기 작업형1(시계열데이터) 17일차 빅분기 독학
R/빅분기 실기(독학)
2022. 12. 18. 18:16
2022년 5월 Sales의 중앙값을 구하시오 library(dplyr) library(lubridate) df%mutate(year=year(Date),month=month(Date)) %>%filter(year==2022&month==5) %>%summarise(med=median(Sales,na.rm=T)) #정답 : 1477685 암기 library(lubridate) 날짜 lubridate year() year(2022-01-01) return값:2022 날짜 lubridate month() month(2022-01-01) return값:1