From i.ucar86 at gmail.com  Sat Sep 23 18:17:22 2017
From: i.ucar86 at gmail.com (=?UTF-8?B?ScOxYWtpIMOaY2Fy?=)
Date: Sat, 23 Sep 2017 18:17:22 +0200
Subject: [Rd] S4 method implementation for S3 class
In-Reply-To: <CAOQ5NyfS7dDLWm+W-k99YCndPd7C8C2WzU3Two3vSXFeeOBvfw@mail.gmail.com>
References: <CALEXWq2Pfutuh1Na5cUaopUyup7WYPddd2HYKBhYGdxesabm0A@mail.gmail.com>
 <CAOQ5NycG-TAu-QAj74Z_LZOurNTPB-yRyGuCpOTkBpGfytvFoQ@mail.gmail.com>
 <CALEXWq0z7UQaoHzfvNbfvQ8Q3vkc5Nvu1Zw4VKSMM9vQzJpphw@mail.gmail.com>
 <CAOQ5NyfS7dDLWm+W-k99YCndPd7C8C2WzU3Two3vSXFeeOBvfw@mail.gmail.com>
Message-ID: <CALEXWq1seCSkhZ7Qpbz_vq24ph0fKO06xdnDWeOi72_ZcKvsJg@mail.gmail.com>

> There is formally no such thing as an S3 class. Just S3 objects with a
> class attribute. You could extend a base class with an S4 class, like
> setClass("IntegerWithUnits", slots=c(units="Units"),
> contains="integer"). Sure, that's a disruptive change, but it would be
> in the right direction.
>
> Extending base classes is always a risky proposition, as you've
> discovered. Ideally you would override every transformation in order
> to adjust or carry over the representation accordingly. The problem is
> that there's a huge amount of transformations available for base
> classes, mostly not encapsulated by generics.
>
> Other possibilities include:
> - Convincing someone to make %*% an internal S3 generic
> - Promoting %*% to an R-level S3 generic, which would only work with
> code that sees your namespace
>
> Hopefully others have better ideas,
> Michael

Thanks for your kind help and suggestions, Michael. I think I'll take
the last option as a workaround, at least until I evaluate the
advantages and drawbacks of a complete redesign.

I?aki



[Rd] S4 method implementation for S3 class
=?UTF-8?B?ScOxYWtpIMOaY2Fy?=