[R] Operator overloading

From: Tine <tine.mlac_at_academa.si>
Date: Thu, 10 Jul 2008 10:54:36 +0200


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.


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 10 Jul 2008 - 08:59:35 GMT

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 10 Jul 2008 - 10:31:30 GMT.

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

list of date sections of archive