Can someone enlighten me on why the following doesn't work?

 

 

setwd('C:/Temp/R')

 

d <- rep(1:53,2)

(s <- ts(d, frequency=53, start=c(2000,10)))

n <- length(s)

k <- n%/%3

 

for(i in (n-k):n)

{

    st <- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] +
i) %% frequency(s))

                ed <- c(start(s)[1] + (start(s)[2]+k+i)%/%frequency(s),
(start(s)[2]+i+k) %% frequency(s))

    xshort <- window(s, start=st, end=ed)

                cat("Start ", st, " End ", ed, "\n")

                cat("Length ", length(xshort), " start ", start(xshort), "
end ", end(xshort), "\n")

}

 

I get a bunch of warnings like:

 

36: In window.default(x, ...) : 'end' value not changed

 

Thank you.

 

Kevin

rkevinburton@charter.net


	[[alternative HTML version deleted]]

