Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Thanks John that is likely the solution to my problem, but I don't understand how I can use it and I can't find the example in the Rcpp package (I did grep for setLoadAtion on the whole source package of Rcpp, but nothing came up with ). Could you please provide me a link (or the filename) where

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Dirk Eddelbuettel
On 4 October 2013 at 12:59, Rainer M Krug wrote: | Thanks John | | that is likely the solution to my problem, but I don't understand how I | can use it and I can't find the example in the Rcpp package (I did grep | for setLoadAtion on the whole source package of Rcpp, but nothing came up with

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Dirk Eddelbuettel e...@debian.org writes: On 4 October 2013 at 12:59, Rainer M Krug wrote: | Thanks John | | that is likely the solution to my problem, but I don't understand | how I | can use it and I can't find the example in the Rcpp package (I did | grep | for setLoadAtion on the

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Dirk Eddelbuettel
On 4 October 2013 at 14:15, Rainer M Krug wrote: | Hm. loadModule is Rcpp function, but I am only interested in using the | setClass() function, which has nothing to do with Rcpp. I don't even use | Rcpp in the package, only in one which is imported. Sorry, assumed Reference Class created via

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread Rainer M Krug
Dirk Eddelbuettel e...@debian.org writes: On 4 October 2013 at 14:15, Rainer M Krug wrote: | Hm. loadModule is Rcpp function, but I am only interested in using the | setClass() function, which has nothing to do with Rcpp. I don't even use | Rcpp in the package, only in one which is imported.

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-04 Thread John Chambers
The basic tool is setLoadActions(), which takes a function definition, with the package's namespace as its argument. Read ?setLoadActions There is no such thing as setLoadFunction, as far as the standard code in R. While you haven't defined didn't work, an off-the-top-of-the-head idea would

[Rd] check warning with .onLoad() and setClass()

2013-10-03 Thread Rainer M Krug
Hi I am writing a package in which I define a new class in the .onLoad() hook: , | .onLoad - function(libname, pkgname) { | setClass( | inDrak, | representation( | init = SpatialGridDataFrame | ), | contains = simObj | ) | } `

Re: [Rd] check warning with .onLoad() and setClass()

2013-10-03 Thread John Chambers
Don't use .onLoad() to set class (or other nontrivial) information at load time. Use setLoadActions(), which was created exactly to get around the limitations of .onLoad(). For an example, see the Rcpp package, which uses this to set up load-time C++ linkages. John Chambers On Oct 3, 2013,