Case Study: Analyzing City Time Series Data in R
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
periodicity(temps_xts)
Daily periodicity from 2007-01-01 to 2015-12-31
periodicity(flights_xts)
Monthly periodicity from 2010-01-01 to 2015-12-01
temps_xts_2 <- temps_xts["2010/2015"]
temps_monthly <- to.period(temps_xts_2,
period = "months")
merge()
determines order of columnsflights_temps <- merge(flights_xts, temps_monthly)
head(flights_temps)
flights temps
2010-01-01 8912 36.12903
2010-02-01 8418 37.71429
2010-03-01 9637 42.22581
2010-04-01 9363 51.26667
2010-05-01 9360 56.87097
2010-06-01 9502 63.56667
Case Study: Analyzing City Time Series Data in R