사례 연구: R로 도시 시계열 데이터 분석
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
saveRDS()와 readRDS() 사용
saveRDS(citydata, file = "citydata.rds")
xts 객체의 시간 인덱스 보존
readRDS("citydata.rds")
pop pct_growth
1980-01-01 562994 NA
1990-01-01 574823 2.057851
2000-01-01 589141 2.430318
2010-01-01 617594 4.607072
write.zoo()와 read.zoo() 사용
write.zoo(citydata, file = "citydata.csv", sep = ",")
xts로 재변환 필요
citydata <- read.zoo("citydata.csv", sep = ",", header = TRUE)as.xts(citydata)
pop pct_growth
1980-01-01 562994 NA
1990-01-01 574823 2.057851
2000-01-01 589141 2.430318
2010-01-01 617594 4.607072
사례 연구: R로 도시 시계열 데이터 분석