From knoblauch at lyon.inserm.fr  Mon Mar 19 19:30:37 2007
From: knoblauch at lyon.inserm.fr (Ken Knoblauch)
Date: Mon, 19 Mar 2007 17:30:37 -0100 (CET)
Subject: [Rd] Having rbind dispatch to a different method than data.frame
 with arguments inheriting from data.frame
Message-ID: <50631.194.57.165.22.1174321837.squirrel@webmail.lyon.inserm.fr>


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/



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