Skip to content

Extending time series

3 messages · Fernando Saldanha, Achim Zeileis, Gabor Grothendieck

#
I noticed that when one tries to extend a time series (ts) object by a
single period using window() actually two observations (NAs) are
added. See below for an example. Does anyone know the reason for this
behavior and how to avoid it?

Thanks.

FS
Time Series:
Start = 1 
End = 5 
Frequency = 1 
[1]  1  2  3 NA NA
#
On Tue, 26 Apr 2005 11:52:00 -0400 Fernando Saldanha wrote:

            
Yes:
  end(x) + 1
is not what you expect it to be. You can set equivalently
  end = 4
  end = c(4, 1)
to achieve what you want and you can compute one of those
representations in various ways, e.g., tsp(x)[2] + 1.
Z