Re: [Rd] Subsetting time series

From: Ross Ihaka <ihaka_at_stat.auckland.ac.nz>
Date: Tue 10 Aug 2004 - 13:01:52 EST

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

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Aug 10 13:06:42 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 08:59:17 EST