From ripley@stats.ox.ac.uk  Wed Aug 11 09:37:36 1999
From: ripley@stats.ox.ac.uk (Prof Brian D Ripley)
Date: Wed, 11 Aug 1999 09:37:36 +0100 (BST)
Subject: Is a ts of length one a ts? (PR#245)
In-Reply-To: <XFMail.990811092338.plummer@iarc.fr>
Message-ID: <Pine.GSO.4.05.9908110928000.12494-100000@auk.stats>

On Wed, 11 Aug 1999, Martyn Plummer wrote:

> On 10-Aug-99 ripley@stats.ox.ac.uk wrote:
> > Is there any good reason why a time series of length one is not
> > allowed by [.ts (you can certainly create one with ts)?
> 
> It certainly has a start and an end value, but what's the
> frequency?  If you want the tsp attribute of a time series
> to be well defined, then maybe you should disallow series
> of length 1.

I think the frequency is perfectly well defined, as that of the series you
subsetted.  How can extracting one observation change the frequency of
observation? Similarly, it is defined by ts, as it is an argument.

> "[.ts" certainly needs fixing.  There has been some discussion
> about this and I think the consensus was that "[.ts" should
> not attempt to return a time series when taking row subsets
> (computationally expensive, and quite difficult to cover
> all cases, see PR#216, PR#217).  The window() function is more
> appropriate for taking subseries IMHO.

You can't control this. Once you have [.ts, it gets used in all sorts
of places deep inside other functions.  For example, in

boxplot(split(nottem, cycle(nottem))

the subsetting in boxplot.stats uses [.ts (in 0.65 where split
preserves classes). So we have to get this right.


-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Is a ts of length one a ts? (PR#245)
Prof Brian D Ripley