I thought this up the other night but I’m not sure where I’m going to use it. But I thought that I would through it out there anyway, maybe it will solve all of someone else’s problems.
I was thinking about classes in R and R is SO NOT object oriented, as much as people claim that it is. There are so many things that it lacks, like data hiding, encapsulation, methods, class level variables, etc. Then I realized that the environments in R can be used in much the same way. I’ll show a couple of examples.