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

Janko Thyson janko.thyson at ku-eichstaett.de
Fri Sep 3 21:55:42 CEST 2010


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


> -----Ursprüngliche Nachricht-----
> Von: Jeff Ryan [mailto:jeff.a.ryan at gmail.com]
> Gesendet: Freitag, 3. September 2010 15:57
> An: Janko Thyson
> Cc: r-devel at r-project. org
> Betreff: Re: [Rd] Stats not loaded? Method for as.ts() results in error
> 
> 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:
> > Dear list,
> >
> >
> >
> > I've got the following problem:
> >
> >
> >
> > In a package I'm trying to build, there exists a method for the
> function
> > "as.ts()". When checking the package, R always throws the error that
> it
> > cannot find a function called "as.ts". To me it seems that the
> package
> > "stats" (home of "as.ts()") is not loaded during the checking process
> even
> > though it's a base package. For testing, I've written a method for
> "plot()"
> > to see if it's a general problem with base-functions, but this one
> passes
> > just fine.
> >
> >
> >
> > Did anyone of encounter a similar problem or could help me out with a
> hint?
> >
> >
> >
> > Thank you very much,
> >
> > Janko
> >
> >
> >
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> >
> 
> 
> 
> --
> Jeffrey Ryan
> jeff.a.ryan at gmail.com



More information about the R-devel mailing list