Skip to content

Stats not loaded? Method for as.ts() results in error

2 messages · Jeff Ryan, Janko Thyson

#
Janko,

You don't mention if you are using S3 or S4.  A small example would
make it easier to identify where your problem is.

Jeff

On Fri, Sep 3, 2010 at 4:44 AM, Janko Thyson
<janko.thyson at ku-eichstaett.de> wrote:

  
    
#
Hi Jeff,

sorry for that! I found the problem in the meanwhile. But since I'm always
grateful to get answers from the list, here's what happened:

I have a method for as.ts()

setMethod(f = "as.ts", signature = "Tsi", definition = function(x, ...) 
{ 
	Function body
})

This is the error I always got while running R CMD check

Error in setMethod(f = "as.ts", signature = "Tsi", definition = function(x,
: 
  no existing definition for function "as.ts"

What I was too stupid to see is the fact that as.ts() isn't a generic in the
first place. Yet, I turned it into one somewhere in my code (which I forgot
;-)) and when I tried to debug my code manually I always misleadingly took
it as an innate generic and wondered why R CMD check always complained about
that fact that it couldn't find it.

Regards,
Janko