[R] FW: S4 classes, creating in C
Richard A. O'Keefe
ok at cs.otago.ac.nz
Tue Jun 24 04:44:52 CEST 2003
Laurence Kell FM CEFAS <L.T.Kell at cefas.co.uk> asked about
> setClass("LUdecomposition", representation(a="matrix", pivot = "integer"),
> prototype=list(pivot = NA) )
>
> then I get the following error message in R 1.7.1 but not R 1.7.0
>
> Error in makePrototypeFromClassDef(properties, ClassDef, immediate) :
> In making the prototype for class "LUdecomposition" elements of the
> prototype
> failed to match the corresponding slot class: pivot (class " integer
> ")
>
> Why can I no longer use the prototype to set the default values?
The prototype says 'pivot = "integer"'.
Had you noticed in the R language PDf file that typeof(NA) = "logical"?
What happens when you try
prototype=list(pivot=as.integer(NA))
instead?
More information about the R-help
mailing list