# out-of-sample variance using rolling window

I am currently working on the comparison of the constructed portfolios using out-of-sample variance criteria. I am going to use rolling window procedure for the comparison. First, I choose a window over which to perform estimation. Length of estimation window let say t is smaller than N, where N is the total number of returns. I use estimation window of t=60 data points which correspond to 5 years for monthly data. Second, using the return data over the estimation window, t, I compute various portfolios. I repeat this rolling window procedure for the next month and dropping the data for the earliest month. I continue this until the end of the dataset is reached. At the end of the this process, I will have generated T-t portfolio weight vectors for each strategy. Does anyone know which package I can use for rolling window algorithm in R or matlab? Thank you for any help.