[Rd] Reissue: Base "Object" class to use in S4 slot specification

Patrick Aboyoun paboyoun at fhcrc.org
Tue Sep 8 18:14:51 CEST 2009


This is a reissue of a question I had asked a few weeks ago to see if 
anyone had any thoughts on the matter.

I am looking to have slot in an S4 class definition that can take any 
(S3 or S4) object. The ANY class seemed to be a good candidate, but the 
is() function definition performs an S3Case test before checking if 
methods:::.identC(class2, "ANY"). The result is the is() function does 
not consider various S3 objects to be of class ANY.

 > is(factor(), "ANY")
[1] FALSE
 > is(lm(I(1:10) ~ rnorm(10)), "ANY")
[1] FALSE
 > sessionInfo()
R version 2.10.0 Under development (unstable) (2009-09-07 r49613)
i386-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

What is the recommended base "Object" class I should define my slot to 
be so it can accept any object?



Patrick



More information about the R-devel mailing list