Could someone point me in the right direction for documentation on the following question?
Let's say I have two objects a and b of classes A and B, respectively. Now let's say I write a function foo that does something similar to objects of type A and B. Basically I want to overload the function in C++ talk, so if I give foo and object of type A something (and this is my question) dispatches the call to, say, foo.A, and if I give foo and object of type B something dispatches the call to, say, foo.B.
I want to write foo.A and foo.B. How to I perform the method dispatch? From what I understand there are two ways in R: S3 and S4. What is the simple S3 way?
[[alternative HTML version deleted]]
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.2.0, at Sun 01 Jul 2007 - 00:32:33 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.