Re: [Rd] "Incompatible methods" for overloaded operator

From: Winston Chang <winstonchang1_at_gmail.com>
Date: Wed, 20 Jun 2012 22:58:12 -0500

On Wed, Jun 20, 2012 at 10:49 PM, Martin Morgan <mtmorgan_at_fhcrc.org> wrote:

> On 06/20/2012 08:06 PM, Hadley Wickham wrote:
>
>> But aren't the methods compatible? If equality doesn't make a method
>> compatible what does?
>>
>
> Actually I guess that turns out to be the key (to why they work at the
> command line but not in a package). At the command line they really _are_
> the same, e.g., .Internal(inspect("+.a")) has the same address as "+.b".
> In the package they (e.g., badadd:::"+.a") have different addresses, I
> suppose because S3method() acts on them independently.
>
>
Thanks for the investigation. I wonder if there's some sort of workaround.

>
>> But unfortunately that doesn't work for S3 classes (even with
>> setOldClass) so it doesn't help much unless we want to rewrite
>> everything in S4 :/
>>
>
> rewrite?
>

Yes, the original question is the result of some issues that came up in ggplot2 development...

-Winston

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 21 Jun 2012 - 04:00:59 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Jun 2012 - 11:20:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive