From jhibschman at gmail.com  Thu Jan 20 16:24:50 2011
From: jhibschman at gmail.com (Johann Hibschman)
Date: Thu, 20 Jan 2011 09:24:50 -0600
Subject: [Rd] setGeneric for residuals, etc
Message-ID: <u1ok4hzfvi5.fsf@lx-chrateresearch01.citadelgroup.com>

I'm experimenting with a few model-fitting classes of my own.  I'm
leaning towards using S4 for my classes, but the R functions I'd want to
override (residuals, predict, etc.) are all S3 methods.

As I understand it, I could do setGeneric("residuals"), then add S4
specializations to it.  However, I don't understand the full
consequences of doing this.  Are there any drawbacks?  Is there some
code that will not run properly if I do this?  It feels like I'm
reaching in and modifying a core R function, which makes me nervous.

To put it another way, if it's completely transparent and causes no
problems, why isn't it done by default?

(If it matters, I'm still on 2.10.1, but I can take it up with global
architecture if there are compelling changes in later versions.)

Thanks,
Johann



[Rd] setGeneric for residuals, etc
Johann Hibschman