"tsp<-"
Paul Gilbert
pgilbert@bank-banque-canada.ca
Wed, 30 Sep 1998 11:38:20 -0400
Martin
I think your fix clobbered mine for NULL assignment and when I went to test a
combined version I discovered that somewhere in the setting of the tsp attr
there is already the check you proposed, and also some other sanity checks. So
my fix for NULL assignment (below again) seems to be the only problem. "tsp<-"
might be a more logical place to put these checks then in attr, but that's a
different question.
Paul
______
"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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._