I have experience with R6 classes but I have not used operator overloading
with them.
Out of curiosity I did a quick search and found this link which provides a
step by step (I am not claiming it is the only way)
https://stackoverflow.com/questions/49463235/arithmetic-operators-overload-for-r6class
Thanks!
On Wed, Mar 24, 2010 at 1:01 AM, Sharpie wrote:
>
>
> Chidambaram Annamalai wrote:
> >
> > Hi,
> >
> > I need some help to get some of the object orientation, specifically the
> > methods that overload the basic arithmetic operations, from sample C++
> > code to R. I don't have experien
Chidambaram Annamalai wrote:
>
> Hi,
>
> I need some help to get some of the object orientation, specifically the
> methods that overload the basic arithmetic operations, from sample C++
> code to R. I don't have experience with such advanced language features
> inside of R. So I was wondering
The 'polynom' package provides one example of how to do this.
However, getAnywhere("+.polynomial") just told me "no object named
‘+.polynomial’ was found"; I don't know why. The documentation says it
uses S3 classes. The 'Matrix' package should provide other examples,
using S4 classes.
hadley wickham wrote:
> On Thu, Jul 10, 2008 at 5:09 AM, Peter Dalgaard
> <[EMAIL PROTECTED]> wrote:
>
>> Tine wrote:
>>
>>> Hi!
>>>
>>> I was just wondering is there anyway to overload operator for custom
>>> class.
>>> For example:
>>> I have two matrices A and B with same dimensions. I w
On Thu, Jul 10, 2008 at 5:09 AM, Peter Dalgaard
<[EMAIL PROTECTED]> wrote:
> Tine wrote:
>> Hi!
>>
>> I was just wondering is there anyway to overload operator for custom
>> class.
>> For example:
>> I have two matrices A and B with same dimensions. I want to overload
>> operator '+' with my own fu
Tine wrote:
> Hi!
>
> I was just wondering is there anyway to overload operator for custom
> class.
> For example:
> I have two matrices A and B with same dimensions. I want to overload
> operator '+' with my own function.
> Or even better can I create my own (new) operator.
> Example:
> A+-B where
7 matches
Mail list logo