[R] should I use setRefClass() ?

From: Ben Nachtrieb <ben.nachtrieb_at_gmail.com>
Date: Sun, 24 Apr 2011 09:20:23 -0600


I am somewhat new to R programming and a novice C++ programmer.

I'd like to know if I should use setRefClass() to manage objects, functions, and data in a very large program I am attempting to code. See:

I like the referential class structure that C++ provides and R seems to provides via setRefClass(). Mainly what I like is that I can code custom member functions that 'do stuff' inside a class.

I understand that setRefClass() kind of gets away from the way R was intended to be used. It is this 'understanding' that makes me worry about using something setRefClass(). The program that I am attempting to build is very big, complex (for me), and it needs to be efficient (from a code readability standpoint and from a speed standpoint). I will be using a lot of the built-in R stats-centric functions. Are there any pitfalls I should be aware of? Any insight or suggestions? I was thinking the setRefClass() function would provide what I like in C++, but allow me to do everything in R (rather than having C++ and R interface with each other).

Thanks for any help!


        [[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. Received on Sun 24 Apr 2011 - 15:23:47 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 Sun 24 Apr 2011 - 15:30:33 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