I'd rather do this without getting into zoo objects at the moment. OK, how about with a simple loop ? Why doesn't this work ?
attach(xyz) j <- for(i in 4: length(Close)) sd(Close[i]:Close[(i-3)]) -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-a-moving-window-on-standard-deviation-tp3247566p3247611.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.