사례 연구: R로 도시 시계열 데이터 분석
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
기간별로 데이터 분할
unemployment_yrs <- split(unemployment, f = "years")
기간 내 함수 적용
unemployment_yrs <- lapply(unemployment_yrs, cummax)
새 데이터를 xts 객체로 결합
unemployment_ytd <- do.call(rbind, unemployment_yrs)
rollapply()는 롤링 윈도우에 함수를 적용합니다unemployment_avg <- rollapply(unemployment,
width = 12,
FUN = mean)

사례 연구: R로 도시 시계열 데이터 분석