I have daily prices series over a wide range of products; I want to convert to a new dataframe with weekly or monthly data.
I first used xts in order to apply the to.weekly function...which works only for OHLC format. I am sure there may exist a function similar to to.weekly but for dataframe where the format is not OHLC.
There a different posts already related to this as the following: Does rollapply() allow an array of results from call to function? or Averaging daily data into weekly data
I eventually used:
length(bra)
[1] 2416
test<-bra[seq(1,2416,7),]
Would there be a more efficient approach? Thanks.