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

rkevinbur...@charter.net


        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to