ケーススタディ: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で都市の時系列データを分析する