search for: oosp2_encapsulated_classes_in_r

Displaying 1 result from an estimated 1 matches for "oosp2_encapsulated_classes_in_r".

2009 Nov 23
1
OOP with Encapsulated Class Definitions
...er) a new class system for R, that uses encapsulated class definitions (i.e. the method definitions are literally inside the body of the class definition). A working (however very rough and poorly tested) system is available in my R package "oosp" with documentation in the vignette "oosp2_Encapsulated_Classes_in_R". A snippet of a class definition follows: (Here double is a method that doubles the value of the attribute x). > MyObject = function (...) { MyObject = function (x) .$x = x double = function () .$x = .$x * 2 mclass () } A snippet of creating and using an object: > myobject...