Skip to content
Prev 46889 / 63421 Next

check warning with .onLoad() and setClass()

Dirk Eddelbuettel <edd at debian.org> writes:
Ok - theat far I folow you. But how do I implement this?

I have now the following .onLoad() function:

,----
| .onLoad <- function(libname, pkgname) {
|     setClass(
|         "inDrak",
|         representation(
|             init = "SpatialGridDataFrame"
|             ),
|         contains = "simObj"
|         )
| }
`----

in the file ./R/onLoad.R in my package.

Now how can I now use the setLoadFunction()? I tried to simply put the
setClass in the setLoadFunction() as follow into the ./R/onLoad.R file:

,----
| setLoadFunction( function(libname, pkgname) {
|     setClass(
|         "inDrak",
|         representation(
|             init = "SpatialGridDataFrame"
|             ),
|         contains = "simObj"
|         )
| }
`----

but this did not work. 

So what do I have to do with it? I only find very few examples using
setLoadFunction().

Rainer