yet another ts problem

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
13 May 1999 20:07:23 +0200


Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:

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

Notice that there's a quickhack(TM) for the specific problem:

    y <- NextMethod("[")
    if (missing(i)) 
        ts(y, start = start(x), freq = frequency(x))
    else {
        n <- if (is.matrix(x)) 
            nrow(x)

insert "if (is.matrix(i)) return(y)" at the beginning of the else clause.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._