Is it possible to refer to an object from within a method, as in *this *in Java? I can't find anything about this in the documentation. Sorry if I missed it. Thanks. *-- Russ Abbott* *_____________________________________________* *** Professor, Computer Science* * California State University, Los Angeles* * Google voice: 747-*999-5105 * blog: *http://russabbott.blogspot.com/ vita: http://sites.google.com/site/russabbott/ *_____________________________________________* [[alternative HTML version deleted]]
On Sat, Mar 19, 2011 at 6:34 PM, Russ Abbott <russ.abbott at gmail.com> wrote:> Is it possible to refer to an object from within a method, as in *this *in > Java? ?I can't find anything about this in the documentation. ?Sorry if I > missed it. >Assuming you are referring to S3, the first argument to a method is the object (unless specified otherwise in the UseMethod call but that is rarely done). -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
You might want to check out Reference Classes (?SetRefClass). The object itself is stored in '.self' and can be referenced that way. HTH, Janko -----Urspr?ngliche Nachricht----- Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von Russ Abbott Gesendet: Samstag, 19. M?rz 2011 23:35 An: r-help at r-project.org Betreff: [R] Referring to objects themselves Is it possible to refer to an object from within a method, as in *this *in Java? I can't find anything about this in the documentation. Sorry if I missed it. Thanks. *-- Russ Abbott* *_____________________________________________* *** Professor, Computer Science* * California State University, Los Angeles* * Google voice: 747-*999-5105 * blog: *http://russabbott.blogspot.com/ vita: http://sites.google.com/site/russabbott/ *_____________________________________________* [[alternative HTML version deleted]] ______________________________________________ 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.
Apparently Analagous Threads
- Help with objects
- Convenience-at-the-expense-of-clarity (was: quantmod's addTA plotting functions)
- Bug or feature: using "ANY" as a generic field class (was: '[R] Is there a (virtual) class that all R objects inherit from?)
- reference classes: question on inheritance
- R as a non-functional language