[R] time series object

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 16 09:04:22 CEST 2004


window() is the normal way to do this.

On Tue, 15 Jun 2004, Laura Holt wrote:

> Hi R People:
> 
> I have a monthly time series x.ts which runs from 1/1995 through 12/2003.
> 
> >x.ts <- ts(x,start=1995,freq=12)
> >str(x.ts)
> Time-Series [1:108] from 1995 to 2004: -1.638 -0.236  0.830 -0.548  0.363 
> ...
> >
> 
> My question: is there a way to print the observations from 1/1999 to 6/1999, 
> please?
> (other than x.ts[49:54])

which does not give you a time series, BTW.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list