class in R: S3 vs S4
I want to create a class in R, should I use S3 or S4 class? I read a lot of different things about them, is there one superior to the other one? S3 can only dispatch on it's first argument, whereas S4 can dispatch on multiple arguments. If you want to be able to write methods for function foo that should do different things if given an object of class "bar" or given objects of class "bar" and "foobar" , or given objects of class "barfoo" and "foobar" , then S4 provides a far better way to handle such complexities. S3 is very simple and easy to implement, but isn't really a formal object