Q:

window function R code

fine people of stackoverflow. I have become trapped on a rather simple part of my program and was wondering if you guys could help me. 
library(nonlinearTseries)

tt<-c(0,500,1000)

mm<-rep(0,2)

for (j in 1:2){mm[j]=estimateEmbeddingDim(window(rnorm(1000), start=tt[j],end=tt[j+1]), number.points=(tt[j+1]-tt[j]),do.plot=FALSE)}

Warning message:
In window.default(rnorm(1000), start = tt[j], end = tt[j + 1]) :
  'start' value not changed

If I plug in the values directly (tt[1], tt[2], tt[3]), it works but I also get a warning
estimateEmbeddingDim(window(rnorm(1000), start=tt[1],end=tt[2]), number.points=(tt[2]-tt[1]),do.plot=FALSE)

[1] 9

Warning message:
In window.default(rnorm(1000), start = tt[1], end = tt[2]) :
  'start' value not changed

Thanks, Matt. 

A:

The problem seems to be with the
window(rnorm(1000), start=tt[j],end=tt[j+1])

lines. First of all, window is only meant to be used with a time series object (class=="ts"). In this case, rnorm(1000) simply returns a numeric vector, there are no dates associated with this object. So i'm not sure what you think this function does. Did you only want to extract the values that were between 0-500 and 500-1000? If so that seems a bit because with a standard normal variable, the max of 1000 samples isn't likely to be much over 4 let alone 500.
So be sure to use a proper "ts" object with dates and everything to get this to work.

