Skip to content
Prev 66639 / 398525 Next

Is there a diferent way to do this?

Gilvan Justino wrote:

            
In S4 it is simple generic(object), the generic chooses the right method 
along the class of object.
Replacement methods are somehow special.
For the "regular" case, you say generic(object, otherArg1, otherArg2, 
......)

For a replacement method, you can also say
   "generic<-"(object, otherArg1, otherARg2, ...)

but for convenience and intuition, you can say

generic(object) <- otherArg1
Yes, but as I already mentioned, replacement methods are somehow special.
You don't want to do replacements in that way, do you?
I assumed (since your questions was quite complex) you are much more 
familar with R, sorry for causing confusion. I think the best way is to 
start reading some docs, not only about S4, but also about S3 classes, 
so you will see why things have been developed this way.

Uwe Ligges