From pgilbert@bank-banque-canada.ca  Mon Sep 28 20:30:03 1998
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Date: Mon, 28 Sep 1998 15:30:03 -0400
Subject: "tsp<-"
Message-ID: <98Sep28.153343edt.13470@mailgate.bank-banque-canada.ca>

If value is NULL I think tsp assignment should not return a class ts object.
Below is a fixed version.

Paul Gilbert
____

"tsp<-" <-function(x, value)
{if (is.null(value))
   {attr(x, "tsp") <- value
    if(inherits(x,"ts")) class(x) <- NULL
    return(x)
   }
 attr(x, "tsp") <-  value
 class(x) <- "ts"
 x
}



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


"tsp<-"
Paul Gilbert