Casestudy: Tijdreeksgegevens van een stad analyseren in R
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
Gebruik saveRDS() en readRDS()
saveRDS(citydata, file = "citydata.rds")
Behoudt de tijdindex van xts-objecten
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
Gebruik write.zoo() en read.zoo()
write.zoo(citydata, file = "citydata.csv", sep = ",")
Moet opnieuw geconverteerd worden naar 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
Casestudy: Tijdreeksgegevens van een stad analyseren in R