Hello, If you do C <- A C[A > X & A < Y] <- 0 you get what it seems you want. Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On Mon, 2009-01-05 at 03:41 -0800, Shruthi Jayaram wrote: > A <- ts(rnorm(120), freq=12, start=c(1992,8)) > X <- 0.5 > Y <- 0.8