I tried to download the stock price and compute the standard deviation in rolling window. I found the library PerformanceAnalytics but they only have the rollin
PerformanceAnalytics
Try this:
library(zoo) rollapplyr(1:10, 3, sd, fill = NA) ## [1] NA NA 1 1 1 1 1 1 1 1
See ?rollapply for more info.
?rollapply