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
For who is looking for this nowdays, use roll_sd of roll package (rdrr.io link).
roll_sd
roll
expr min lq mean median uq max neval rollapply(STK, width = 5, sd) 34703.2817 37535.3761 40422.77272 38005.02 38357.489 53512.7018 5 roll_sd(STK, 5) 18.9334 18.9973 23.90904 19.14 30.608 31.8665 5