From ripley at stats.ox.ac.uk  Wed Nov 10 12:08:59 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed Nov 10 12:09:10 2004
Subject: [Rd] Formatting of times in time series objects
In-Reply-To: <1829981A-32F8-11D9-9B01-000A95CDA0F2@anu.edu.au>
Message-ID: <Pine.LNX.4.44.0411101104420.14915-100000@gannet.stats>

On Wed, 10 Nov 2004, John Maindonald wrote:

> Although print.ts() formats times pleasantly when it prints
> regular multivariate time series (at least for suitable series)
> (try e.g.
>  > xy <- cbind(window(AirPassengers, end =1950), 1:11)

I get an error here, as I should.

>  > window(xy, end=1949)
>            xy seqno
> Jan 1949 112     1
> )
> I can find no immediate way to extract the pleasantly
> formatted date.  I am wondering what plans there may be
> to modify format() to provide a choice of formats for the times
> in ts objects [presumably via as.Date(), rather than by code
> such as in print.ts()], or if some other solution is in view.

No plans.  ts() objects do not in fact contain the times, just a tsp 
attribute, but it is easy enough to write code to get what you want.

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Formatting of times in time series objects
Prof Brian Ripley