I am trying to split multiple xts objects with one unique irregular time series. split.xtsdivided by days, minutes, seconds, etc. Using breakpoints requires vectors of equal length, which leads to an error when trying to break my data.
dd <- c("2014-02-23","2014-03-12", "2014-05-29")
tt <- c("03:15:52", "03:49:17", "04:03:24", "05:30:19", "05:56:49",
"06:14:04", "09:42:13", "11:57:25", "11:58:02", "12:12:49",
"15:38:00", "15:44:21", "16:16:04")
dt <- c(outer(dd,tt,paste))
xx <- as.xts(seq_along(dt), as.POSIXct(dt))
spltr <- c("2014-01-13 12:09:32", "2014-02-09 06:23:41",
"2014-03-01 13:35:12", "2014-05-14 07:12:52")
I am trying to divide xxby spltrto find the frequency of entries in each part. I tried aggregate(xx,by=spltr,length), but I get an error because it spltrhas the same length as xx. split.xtsdoes not work because it is spltrnot regular.
source
share