Re: [R] Operator Overloading in R

2019-01-16 Thread Eric Berger
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

[R] Operator Overloading in R

2019-01-16 Thread Mahnoor Malik
I am using R6 class and I have to do operator overloading (+ ,-,*) for a custom data type . What will be the necessary steps ? I am totally confused as to what should I do in order to implement this . Thanks [[alternative HTML version deleted]] ___

[R] * operator overloading & setOldClass

2012-05-03 Thread Jan Wijffels
Dear R gurus, I am trying to overload some operators in order to let these work with the ff package by registering the S3 objects from the ff package and overloading the operators as shown below in a reproducible example where the "*" operator is overloaded. require(ff) setOldClass(Classes=c("ff_

Re: [R] Operator overloading for custom classes

2010-03-23 Thread Chidambaram Annamalai
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

Re: [R] Operator overloading for custom classes

2010-03-23 Thread Sharpie
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

[R] Operator overloading for custom classes

2010-03-23 Thread Chidambaram Annamalai
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 if some of you could help me out in this regar

Re: [R] Operator overloading

2008-07-10 Thread Spencer Graves
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.

Re: [R] Operator overloading

2008-07-10 Thread Peter Dalgaard
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

Re: [R] Operator overloading

2008-07-10 Thread hadley wickham
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

Re: [R] Operator overloading

2008-07-10 Thread Peter Dalgaard
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

[R] Operator overloading

2008-07-10 Thread Tine
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 '+-' would be some function