How to transform xts to lower frequency in a cumulative way
问题 I am trying to convert xts time series data to lower periodicity in a cumulative way. For example, using to.weekly on sample data (sample_matrix) from xts package I get this: library(xts) data(sample_matrix) to.weekly(as.xts(sample_matrix), name="") > to.weekly(as.xts(sample_matrix), name="") .Open .High .Low .Close 2007-01-08 50.03978 50.42188 49.95041 49.98806 2007-01-15 49.99489 50.68583 49.80454 50.48912 ..... I would like to be able to use a slightly different function to.weekly