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

2010-09-03 Thread Janko Thyson
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@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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

2010-09-03 Thread Duncan Murdoch

Janko Thyson 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.
  


Are you using a NAMESPACE, and declaring your method as a method?  If 
you don't, R will have to guess what the methods are, and it might be 
getting mixed up because of the unusual name of the generic.


Duncan Murdoch


 


Did anyone of encounter a similar problem or could help me out with a hint?

 


Thank you very much,

Janko

 

  



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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

2010-09-03 Thread Jeff Ryan
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.thy...@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@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel





-- 
Jeffrey Ryan
jeff.a.r...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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

2010-09-03 Thread Janko Thyson
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.r...@gmail.com]
 Gesendet: Freitag, 3. September 2010 15:57
 An: Janko Thyson
 Cc: r-de...@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.thy...@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@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
 
 
 
 --
 Jeffrey Ryan
 jeff.a.r...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel