I am familiar with the zoo function rollapply which allows you to do rolling computations on zoo or xts objects and you c
zoo
rollapply
xts
As an answer to "Is the zoo/xts conversion needed?": It isn't needed in this case, but rollapply won't work if you send it a dataframe, as I recently discovered from this StackOverflow answer