yet another ts problem

Paul Gilbert pgilbert@bank-banque-canada.ca
Thu, 13 May 1999 11:25:15 -0400


Ross Ihaka wrote:

> 1. I think that "[.ts" tries too hard to turn its value back into
>    a time series.  ...

I agree with this, although, despite all the bugs I'm reporting, a lot of "[.ts"
works ok. All of my calls to "[.ts" that should try to preserve time series
properties are (or should be) from window or some window like utilities that I
use in my tframe kernel. So there is a lot of duplication because these are
already doing most of the stuff that "[.ts" is trying to do too.

(My tframe kernel used to completely take over  all time series including "ts",
but to do that I had to redefine some top level generics like window and plot -
which I think would eventually lead to trouble. My recent batch of ts problems
is because I have changed things so I don't take over the top level. This gives
more control to the class methods, which I think is the way it should work.)

>    In S there is no "[.ts", and a simple array subset is returned.

Splus 3.3 has  "[.its", "[.cts", and "[.rts", the class methods for time series.
However, I haven't used them much and I have no idea if they work properly.

Martyn Plummer wrote:

>An alternative to using "[.ts" to take row subsets would be to
>expand the window.ts() function to include a "freq" or "deltat"
>argument.

I don't see why this should be necessary? window works with dates and
automatically knows the frequency of the object.

>One can then use window() to thin out a regular time series
>and "[.ts" could be modified to just return a simple array subset

That is the way I (try to) use it already. I think if you're doing time-wise
stuff then you should be using dates, except at the lowest level when you need
to get into the representation and use "[". That is probably the main thing that
my tframe kernel lets me do fairly easily.

>(in the process get rid of the horrible warning about not returning a
>time series).

YES PLEASE !! In fact, I always have to redefine that function or I can't see my
output for all the warning messages.

Paul Gilbert

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._