Hello,

I have again a "good practices"/programming theory question regarding 
data.frames.

One of the fundamental objects that I use is the data frame with a particular 
set of columns that I would fill or get information from, and an entire system 
would revolve around getting information from or putting information to such 
data.frame.

On a different OOP programming language I would be tempted to create a class 
that would "wrap-around" that data.frame and create "getters" and "setters" 
methods that would return whatever information I need. I started doing that 
using S4.

Does anyone have examples of packages that use that approach or any 
suggestions?  It just seems to me that a class/object would be a better idea 
because it would create a single, hopefully well validated way to access 
information and edit the fundamental data.frame object, which would be helpful 
if there are several programmers on the team and/or if some of the data.frame 
manipulations are not straightforward and are best left encapsulated in a 
method of a class, and then have people use that method.  I would just like to 
know if there are reasons not do it that way and if there are any examples of 
packages that use that approach and that I can learn from.

Thanks in advance,

Ramiro

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to