Skip to content
Prev 131929 / 398503 Next

S3 and S4 clash

Dear Prof. Ripley: 

      Thanks for your help.  I very much appreciate your great 
generosity in both your substantive contributions to the code and 
documentation for R and in responding to so many questions, helping to 
make R what it is today. 

      In the real application that led to the toy example below, I had 
defined

            AIC.factanal <- function(object, ..., k=c(2, "BIC")){ ... }

      1.  If I understand your suggestion, I'd be better NOT defining an 
"AIC.factanal" but instead define only "logLik.factanal" and let methods 
dispatch go through "AIC.default" to "logLik.factanal".  Is this correct? 

      2.  Is it inappropriate to supply other optional values for an 
argument in a generic function like this? 

      3.  If it is OK to specify options for "k" like this, how would 
you suggest I do it?  Use the S4 standard? 

      Thanks again. 
      Spencer Graves
Prof Brian Ripley wrote: