Re: [Rd] match gets confused by S4 objects

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Tue 07 Feb 2006 - 16:49:38 GMT

>>>>> "Seth" == Seth Falcon <sfalcon@fhcrc.org> >>>>> on Tue, 07 Feb 2006 07:20:17 -0800 writes:

    Seth> On 7 Feb 2006, maechler@stat.math.ethz.ch wrote:
>> The solution has been agreed to be changing the internal
>> representation of S4 objects making them a new SEXP (basic R
>> "type"); and as Brian alludes to, the problem is that those in
>> R-core that want to and are able to do this didn't have the time
>> for that till now.

    Seth> The explanations from you are Brian are helpful, thanks.  I was aware
    Seth> that the issue is the internal representation of S4 objects and was
    Seth> hoping there might be a cheap work around until a new SEXP comes
    Seth> around.

    Seth> It seems that S4 instances are less trivial to detect than one might     Seth> expect before actually trying it.

    Seth> I suppose one work around is to have an S4Basic class that defines
    Seth> methods for match(), c(), etc and raises an error.  Then extending
    Seth> this class gives you some protection.

well; not so easy for c() !! {see the hoops we had to jump through to do this for cbind() / rbind() (used in 'Matrix')}.

But it might be interesting; particularly since some have said they'd expect a considerable performance penalty when all these basic functions would become S4 generics...

Martin



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Feb 08 04:03:13 2006

This archive was generated by hypermail 2.1.8 : Wed 08 Feb 2006 - 18:58:44 GMT