[Rd] Having rbind dispatch to a different method than data.frame with arguments inheriting from data.frame

Ken Knoblauch knoblauch at lyon.inserm.fr
Mon Mar 19 19:30:37 CET 2007


I have defined an S3 class that inherits from data.frame.  It has
some additional attributes and a particular structure that a modeling
function that I wrote require.   I want to write an rbind
method for this class which will combine the attributes correctly
as well as the data.frame components.  But the help page for
rbind indicates

Note that this algorithm can result in calling the data frame method if
the arguments are all either data frames or vectors

and indeed, the data.frame method is called unless I explicitly
invoke

rbind.mymethod(mm1, mm2)

How can I get dispatch to mymethod rather than data.frame?

I can imagine stripping the data.frame class before the call,
but this seems awkward and I am hoping that there is a better way.

Thank you.



-- 
Ken Knoblauch
Inserm U846
Institut Cellule Souche et Cerveau
Département Neurosciences Intégratives
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.pizzerialesgemeaux.com/u846/



More information about the R-devel mailing list