[R] Definition of generic function for subclasses

Alexander juschitz_alexander at yahoo.de
Tue Mar 13 12:34:53 CET 2012


Hi,
I am working on a project, which contains S4 classes and subclasses. Lets
assume the following organisation:
A: S4 Class
B,C: inherit from A
D,E,F,G: inherit from B
H,I: inherit from C

I want to define now a generic function, which returns me the name of the
class. I can now write the function with "A" in the signature. Is there any
reason to write the function for B,C, D,E,... with "B","C","D","E", .. in
the signature ? I can imagine that it can become a mess if for example I
write a function for "A" and a special function for "I" (lets assume, I is
the only exception).

Have you any best-work-pratice to share ?

Thanks
Alexander

--
View this message in context: http://r.789695.n4.nabble.com/Definition-of-generic-function-for-subclasses-tp4468837p4468837.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list