From ihaka at stat.auckland.ac.nz  Tue Aug 10 05:01:52 2004
From: ihaka at stat.auckland.ac.nz (Ross Ihaka)
Date: Tue Aug 10 05:04:00 2004
Subject: [Rd] Subsetting time series
In-Reply-To: <41183517.7030302@buseco.monash.edu.au>
References: <41183517.7030302@buseco.monash.edu.au>
Message-ID: <41183AA0.8010203@stat.auckland.ac.nz>

Rob Hyndman wrote:
> When part of a time series is extracted, the time series component is 
> lost. e.g.,
> x <- ts(1:10)
> x[1:4]
> 
> It would be nice if there was a subsetting function [.ts to avoid this 
> problem. However, it is beyond my R-coding ability to produce such a 
> thing.  Is someone willing to do it?

Have you had a look at "window"?  The problem with "["
its that it can produce non-contiguous sets of values.

-- 
Ross Ihaka                         Email:  ihaka@stat.auckland.ac.nz
Department of Statistics           Phone:  (64-9) 373-7599 x 85054
University of Auckland             Fax:    (64-9) 373-7018
Private Bag 92019, Auckland
New Zealand


[Rd] Subsetting time series
Ross Ihaka