I have xts
time-series object for 10 days of data. The data is sampled at minutes frequency. Therefore, for each day, I have 1440 observations. I need to coerce
library(xts)
library(ggplot2)
library(reshape2)
set.seed(42)
timevalues = "20150101 0000/20150110 2359"
timesequence <- timeBasedSeq(timevalues)
min_data <- xts(rnorm(14400),timesequence)
ts_data <- ts(as.numeric(min_data), frequency = 1440)
out <- stl(ts_data, s.window = "per")
time.series <- as.data.frame(cbind(ts_data, out$time.series))
colnames(time.series) <- c("Data", "Seasonal", "Trend", "Remainder")
time.series$Date <- timesequence
time.series <- melt(time.series, 'Date')
ggplot(time.series, aes(x=Date, y=value)) +
geom_line() +
facet_free(variable~.)