I don't know if timeboxing is the correct term to use to accomplish what I'm attempting, so allow me to explain. I have a set n of tagged observations in time series t. What I'm interested in is taking i seconds before and after every n. My code is below: # observations.xts is an xts time series and arg is the number of seconds to for the timebox timeboxes <- sapply(c(1:as.numeric(last(index(observations.xts))-arg)), function(x) { return(observations.xts[index(x) - arg, index(x)+arg])}, simplify=TRUE) What I'd like to see in timeboxes is observations.xts elements with timestamps within the range of abs(arg). -- Sent from my mobile device Envoyait de mon portable
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.