"tsp<-"

Paul Gilbert pgilbert@bank-banque-canada.ca
Mon, 28 Sep 1998 15:30:03 -0400


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