Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined slot classes in definition?

I am trying to build a package that contains own S4 class definitions. R check works but issues the following warning: undefined slot classes in definition mySecond.

I set to classes while one slot in the second class is of class myFirstClass. E.g.:

setClass("myFirst",representation(field_one = "character",
                                  field_two = "list")
         )

setClass("mySecond",representation(a = "character",
                                   b = "myFirst")
         )

Note:Though S4 might be easier to handle I'd like to stick to S4 here, because I am mapping information from a database and prefer S4's stricter definitions in this case. The compilation does work but I try to fulfill CRAN's standards here and want to get rid of the warnings. Btw: getClassDef gives reasonable result for both classes.

like image 788
Matt Bannert Avatar asked Aug 23 '13 13:08

Matt Bannert


1 Answers

Maybe your class definitions are in separate files, and the collation is such that mySecond is defined before myFirst? See the Collate: field in DESCRIPTION (Section 1.1.1 of RShowDoc("R-exts"), or follow one model of structuring packages where a file AllClasses.R contains class definitions.

like image 118
Martin Morgan Avatar answered Oct 29 '22 16:10

Martin Morgan